1

所以我完全爱上了 Orman Clarke 的“Classica”wordpress 主题,但无法链接到预过滤的内容始终是个问题。不幸的是,我在 1.1.4 版本中下载(并找到了一些解决方案),但是自从我升级到 1.2 后,我还没有能够按预期使用流沙功能。“全部”有效,但实际的过滤器都没有——内容只是消失了。

1.1.4 有流沙/jq 过滤与永久链接解决方法一起工作。

我将代码直接从旧模板复制到新模板,但这并不能解决问题。我试过并排运行两个版本并比较源代码,但我看不出有什么区别。我什至系统地从旧文件到新文件一个接一个地复制文件,看看什么能解决问题。

真的有点麻烦 - 所以如果有人能指出我的代码中的问题所在..那将不胜感激。

http://www.colorspace.am/portfolio

在旁边:

我的永久链接过滤解决方案的代码如下。它要求我为每个过滤器构建一个页面,但现在已经足够了。

        <h1 class="page-title">
            <?php 
            global $post;
            if(get_post_meta($post->ID, 'heading_value', true) != ''): 
                echo get_post_meta($post->ID, 'heading_value', true); 
            else: 
                _e('Some of my recent work.', 'framework'); 
            endif; 
            ?>
        </h1>

        <!--BEGIN #recent-portfolio  .home-recent -->
        <div id="recent-portfolio" class="home-recent portfolio-recent clearfix">

            <?php while (have_posts()) : the_post(); ?>
            <!--BEGIN .sidebar -->
            <div class="sidebar">
<?php
$Path=$_SERVER['REQUEST_URI'];
if ($Path=="/portfolio")
{
echo "<h3>Filter:</h3>";
echo "<ul id=\"filter\">";
echo "<li class=\"segment-1\"><a data-value=\"all\" href=\"#\">All</a></li>";
wp_list_categories(array('title_li' => '', 'taxonomy' => 'skill-type', 'walker' => new             Portfolio_Walker()));
echo "</ul>";
} 
else {
echo "<a href=\"/portfolio\">← return</a>";
}
?>
            <!--END .sidebar -->

            </div>

            <?php endwhile; ?>



            <!--BEGIN .recent-wrap -->

            <div class="recent-wrap">



                <ul id="items" class="image-grid">



                    <?php 
        $count = 1;
                    $query = new WP_Query();
                    $query_string = 'post_type=portfolio&posts_per_page=-1&orderby=title&order=asc';
                    if($post->post_name != 'portfolio') $query_string .= '&skill-type=' . $post->post_name;
                    $query->query($query_string);
                    while ($query->have_posts()) : $query->the_post(); 
        $terms = get_the_terms( get_the_ID(), 'skill-type' );
                    ?>



                        <li data-id="id-<?php echo $count; ?>" class="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>">

                        <!--BEGIN .hentry -->
                        <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">

                            <div class="post-thumb">
                                <?php tz_lightbox(get_the_ID()); ?>
                            </div>

                            <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>"> <?php the_title(); ?></a></h2>

                            <!--BEGIN .entry-content -->
                            <div class="entry-content">
                                <?php the_excerpt(); ?>
                            <!--END .entry-content -->
                            </div>

                        <!--END .hentry-->  
                        </div>

                    <?php
                    $count++;
                    ?>

                    </li>

                    <?php endwhile; wp_reset_query(); ?>

                </ul>

            <!--END .recent-wrap -->
            </div>

        <!--END #recent-portfolio .home-recent -->
        </div>

4

1 回答 1

0

functions.php 中用于过滤的代码必须用以前的版本换掉(我想我用 1.2 来修复)——其他文件都不需要修改。

如果我知道functions.php 已更改,我可能会先查看那里。

于 2011-10-05T05:49:13.643 回答