Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a problem with the pagination on my category pages. I have researched this for a few days now without any luck finding any solutions online.

Here's the problem, when you select "older" or "newer" posts on the particular category page it takes you back to the home page of my site (but this url shows: /test/page/2) with the filtered posts of the home page displayed.

I don't have specific category.php templates, but the theme has a pagination.php file and a wp page-navi.css.css hard coded.

This is the pagination.php code:

<?php if (get_option('paging_mode') == 'default') : ?>
<div class="pagination">
    <?php previous_posts_link(__('Newer')); ?>
    <?php next_posts_link(__('Older')); ?>
    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); ?>
</div>
<?php else : ?>
<div id="pagination"><?php next_posts_link(__('LOAD MORE')); ?></div>

I 'm a loss on how to fix this. Both the Main Index Template and Archive.php file calls up this pagination file.

Any help will be hugely appreciated.

share|improve this question
finally figured out what the problem was - my permalinks settings is not on the default, but custom - it is set to /%postname%/. now the question is how do i change the pagination.php coding from "default" to the custom permalink structure? – len1982 Jul 7 '11 at 0:32

closed as too localized by toscho Jul 6 '12 at 19:58

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

Need more info to answer question.

On the front end what is the url for the next and prevous links?

Can you tell us the url for your site where you are having the problem?

Without a category.php page, it will be archive.php that is displaying the page and calling pagination.

I assume you are using pretty permalinks?

share|improve this answer
thanks for the help and yes, i'm using pretty permalinks. here is a link: wwww.coolinthepool.com/test/ – len1982 Jul 7 '11 at 0:52
I'm thinking that this code needs to change: <?php if (get_option('paging_mode') == 'default') : ?> – len1982 Jul 7 '11 at 0:54
My first step for troubleshooting would be to turn off pretty permalinks and use the default url. Then see if the paging works. If it works then you will know that it is being caused by pretty permalinks. You may have to include the category in your permalink. /%category%/%postname%/ – danielwiener Jul 7 '11 at 11:04
len1982, I believe pagination works within categories. So I tried this url http://coolinthepool.com/test/category/radio/page/2 and it worked. Otherwise WP thinks that 'page' and '2' are Pages or Posts. I am not sure that WP and PageNavi will let you paginate all posts when using /%postname%/ as permalink. – danielwiener Jul 7 '11 at 12:28
I noticed this plugin, which may help you. wordpress.org/extend/plugins/category-pagination-fix and you might want to read this. digwp.com/2011/06/dont-use-postname – danielwiener Jul 7 '11 at 12:30
show 2 more comments

Try WP Page Numbers plugin,it's working perfectly with me..

In the admin panel under Settings > Reading > [Blog pages show at most] just set it to (1) to avoid not-found 404 error.

You still can adjust number of posts per page from this plugin by its page within admin panel.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.