misterpatrick67
Member
Posted 2 years ago #
Hello all,
I have a home page that I currently have post counts set to 15. Problem is, specific categories are getting many more postings than others. Is there a way to limit specific categories to say 3 most recent posts, thus letting other categories maintain a presence on the home page? Not quite sure what the approach would be. Thanks!
misterpatrick67
Member
Posted 2 years ago #
Thanks for the tip! I'll take a look and see how they are coding that. If anyone has any loop tips, those would be great as well as I prefer to not rely on plug-ins. Thanks!
Example of proper pagination:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('cat=3&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
?>
See the WordPress Default theme's wp-content/themes/default/index.php for example of using the template tags, previous_posts_link() and next_posts_link().
Related:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchy