Forums

Please help with loops and posts_nav_link(); (1 post)

  1. irinazaks
    Member
    Posted 6 years ago #

    Results from <?php posts_nav_link(); ?> are not diplayed on my index pages when I am using loop describied here:
    http://codex.wordpress.org/The_Loop#More_Loop_Resources
    to display only latest post from several categories.

    I am novice in php, and do to understand which part of the code causes the problem, and what I can do to get results from posts_nav_link request.

    irinaz@yahoo.com
    Thanks for you help!

    This is a code that gives me a problem.
    <?php $my_query = new WP_Query('category_name=featured&showposts=1');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;?>
    <!-- Do stuff... -->
    <?php endwhile; ?>
    <!-- Do other stuff... -->
    <?php if (have_posts()) : while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    <!-- Do stuff... -->
    <?php endwhile; endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic