1

我对我的网站模板的 css 表的编码感到困惑。如果你去www.ohepic.com你可以看到前十个条目的博客......然后下一次它也会与较旧的博客再次重复......

我怎样才能防止这种重复发生?有人可以帮我找出影响这个的 CSS 表吗?我该如何改变它?

4

1 回答 1

0

创建一个类别,然后您可以尝试此代码。它可能会有所帮助

 <?php   
        $args=array(
          'cat' => ***,
          'post_type' => 'post',
          'post_status' => 'publish',
          'posts_per_page' => 10,
          'caller_get_posts'=> 1
          );
        $my_query = null;
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          echo 'List of Posts';
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
          <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
          endwhile;
        }
    wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

注意:***是 Catagory_id

于 2012-05-07T04:32:04.703 回答