I’m working on a rather convoluted WordPress setup which uses quite a lot of plugins. (BuddyPress, bbPress and WPML to name a few)
Unfortunately, the paging on the BuddyPress front page no longer seems to be working.
When I add some basic echos in WP’s query.php file, I get the following results (these numbers follow eachother, so it appears the query fires twice) :
posts: 14 (found_posts) ppp: 10 (posts_per_page) max: 2 (max_num_pages) posts: 10 ppp: 10 max: 1
When I check to see if I’m in the main query when echoing the numbers, I get the following results:
posts: 14 ppp: 10 max: 2
So apparently, the main query is returning the correct results, but the main query results aren’t the ones being displayed/used on the homepage.
I wrote my own plugin which hooks into pre_get_posts, but this isn’t skewing the results. If I disable the hook, it’s still showing the query being run twice, with slightly different results, since my custom plugin excludes a few categories from the results.
Would anyone know how I can get the query to get the correct number of posts and fix the pagination? What may be causing the query to fire twice?
- The topic ‘Main query fires twice, pagination is broken’ is closed to new replies.