• Hi all,

    I have been playing around with wp_query this weekend but am not sure how to rewrite this into the wp_query:

    <?php query_posts($query_string.'&showposts=1'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    some stuff here
    <?php endwhile; endif; ?>

    I thought this would work:

    <?php
    $featurePosts = new WP_Query();
    $featurePosts->query('showposts=1');
    ?>
    
    <?php if ($featurePosts->have_posts()) : while ($featurePosts->have_posts()) : $featurePosts->the_post(); ?>
    Stuff here
    <?php endwhile; endif; ?>

    Is this right as it does not let me display <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?> within the ‘other stuff’

    Thanks for any assistance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wp_query question about if..while’ is closed to new replies.