In my RSS feed, for example in a custom conditional URL:
I'm getting all my required tags, after editing
With pagination enabled using
&paged=# I can get into any pages within it. But when I get into a dead-end, it typically generates a 'not found' page.
Now my pagination is enabled showing 10 posts per page. So when
cat=3 has 15 posts only, on first page it's showing 10, on second it's showing 5, and on third page it's showing a 'not-found' page.
So, now I'VE TO COUNT HOW MANY POSTS FOUND under this custom URL.
Please note, I'm not using any
WP_Query() thing here and
wp_count_posts not working for me.
- How can I do this?
get_posts(), but it by default restricting the page to load only 5 posts max. So I passed a custom argument into it locally:
<postCount><?php $allPosts = array( 'numberposts' => -1 ); $posts = get_posts( $allPosts ); echo $count = count($posts); ?></postCount>
NOT WORKING! It's exhausting the allocated memory size querying all, so it's I think not suitable because it's a time consuming thing, will pose load also.
So, HOW DO THEY DO IT?