Previous Entries Next Entries Navigation pulling the same 2 posts
-
Hi, this is my first post on the forum and my first WordPress site. I’ll try to be as specific as possible, but please forgive any noobisms.
My site is https://www.lenfertdesign.com
My theme is Cumulus v.1.2 (Demo)My issue is with the Previous Entries and Next Entries navigation on my portfolio.php page and archive.php pages. You can see there are a couple different outcomes when clicking on Previous Entries.
1. https://lenfertdesign.com/work/
in this case it simply reloads the same 2 posts regardless of the page/url position2. https://lenfertdesign.com/magazines/
in this case I get a “page not found” error. This is the archive for the category “magazines”An example of the links working on the theme demo can be found here
In the WP/Dashboard/Settings/Reading/Blog pages to show at most, I’ve set to 2 posts. I have 7 posts in the category “portfolio” and 3 posts in the category magazines. That way I will see the Previous Entries link. In portfoilo.php this code queries the posts.
<?php query_posts('category_name=Portfolio'); global $more; $more = 0;
looking at other forum posts (all over a year old) I’ve also tried this code to replace the code above. Either way the result is the same.
<?php if (is_home()) { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=Portfoilo"); } ?>
This is all the code for the navigation links.
<div class="navigation"> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <div class="alignleft"><?php next_posts_link('← Previous Entries') ?></div> <div class="alignright"><?php previous_posts_link('Next Entries →') ?></div> <!--<?php } ?>--> </div>
Some ideas:
My portfolio page is actually my “work” page and I’m not sure if the page naming has some effect on things, but I don’t expect that would be the case for the archive page for the “magazines” category.I’m not sure what the if(function_exists(‘wp_pagenavi’)… is doing if anything. When I comment it out, I still get the same result and I can’t seem to find that function anywhere to examine it. Most of what I’ve read seems to point at the query on the specific pages overpowering a previous query that gives pagination details.
Again I’m very new to wordpress & php, but I can find and report any details or code that might be helpful to anyone who has an idea how to fix this issue. I’m in day 2 of troubleshooting and hitting a wall.
- The topic ‘Previous Entries Next Entries Navigation pulling the same 2 posts’ is closed to new replies.