我想在我的循環,它位於index.php中有兩個不同的查詢。我正在使用WP codex,但它沒有工作。我希望以後每一篇文章都在自己的特殊DIV中,所以這只是我工作的開始。循環不顯示帖子
問題是,代碼的第二部分不起作用,我不知道爲什麼。據我所閱讀的法典,一切都應該沒問題。請幫幫我。
<div class="col1">
<?php
$my_query = new WP_Query('category_A tym=featured&posts_per_page=1');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?>
<!-- Do stuff... -->
<?php get_template_part('content', get_post_format()); ?>
<?php endwhile; ?>
<!--Over here everything works fine!-->
<!--This code doesnt show up. It is supossed to show 1 post, only heading and date with author. But it doesnt show nothing at all.-->
<?php
$my_queryOne = new WP_Query('posts_per_page=1');
while ($my_queryOne->have_posts()) : $my_queryOne->the_post();
if ($post->ID == $do_not_duplicate)
continue;
?>
<!-- Do stuff... -->
<h2 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
<?php
endwhile;
?>
</div>