Forums › Forums › Search & Filter Pro › Page #2 of results + hide categories doesn't work
- This topic has 5 replies, 2 voices, and was last updated 10 years, 2 months ago by Ross.
-
Anonymous(Private) July 10, 2014 at 10:51 am #2324
Hello,
I found another small issue with the plugin:
When there are more than one page of results, only the first page is shown. I can see the links to page2, 3 and so on, but when I click on them, it either gives me a 404 error, or show me the first page of results still. (http://www.tourdecartes.com/test1)Additionally I tested further the category issue I still have on my site (hide categories feature not working). I installed a fresh copy of wordpress on a different host. Added ONLY search filter pro. I created a few categories and tried to hide one of them… Still didn’t work. It is the 2014 theme so I really think the issue actually comes from the plugin. (test site here: http://tdc.expertauxcartes.com/)
If you want access to the test site, I’ll be happy to give it to you.
You can seeHope you could help.
Best regards,
EmmanuelRoss Moderator(Private) July 10, 2014 at 11:25 am #2334Hey Emmanuel, sorry about that I will check again to see what is happening with the categories. In regards to your pagination, you should just use the default WP functions for that and it should work!
http://codex.wordpress.org/Pagination
and specifically this part needs to be in your main loop:
<div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div> <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
Let me know if this works?
Thanks
Ross Moderator(Private) July 10, 2014 at 8:27 pm #2356Hey Emmanuel
Your template is likely already using the main loop (http://codex.wordpress.org/The_Loop) – this is how your templates display your posts – the main loop in its most basic form looks something like this:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!-- do stuff ... --> <?php endwhile; ?> <?php endif; ?>
The main part to look out for in your template file is
while(have_posts())
– then anything inside there is inside the main loop;So the above code with pagination (the WP way) would become:
<!-- Start of the main loop. --> <?php while ( have_posts() ) : the_post(); ?> <!-- the rest of your theme's main loop --> <?php endwhile; ?> <!-- End of the main loop --> <!-- Add the pagination functions here. --> <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div> <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
Just to note, I think I explained wrong and from looking at the example, the code for pagination should be outside the main loop not inside… oops :/
Let me know if this makes sense?
Ross Moderator(Private) October 2, 2014 at 11:38 am #5467This has now been implemented in the latest version 🙂
Thanks
-
AuthorPosts