[resolved] Query Posts Problem (4 posts)

  1. thejester12
    Posted 8 years ago #

    Hello all, I'm working on a custom theme for my website. It's getting a little complicated because I'm trying to do a few things. I think I've got it all working except for the "Older Entries" and "Newer Entries" links to work on the main index theme page. Even though they link correctly, the same posts stay up.

    Part of the problem, I realize, is that I'm using the Query Posts feature. I learned about how to get pagination back from this post.

    Unfortunately, even though I implemented some of that code, I still seem to be having problems.

    If anyone could help me out, that would be very appreciated, here is the code for my theme's index page on pastebin:


  2. thejester12
    Posted 8 years ago #

    Please? Could someone maybe just look at the code and see if they have any ideas? Your help would be really appreciated.

  3. Kafkaesqui

    Posted 8 years ago #

    Change your first use of query_posts to:

    <?php $posts_query = new WP_Query('cat=14&showposts=3'); ?>
    <?php if ($posts_query->have_posts()) : while ($posts_query->have_posts()) : $posts_query->the_post(); ?>

    That should clear up the conflict on the page.


  4. thejester12
    Posted 8 years ago #

    Thank you so much, this is awesome! I tried it out and it worked like a beaut!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.