Hi enfold support,
one question:
Creating new pages with the blog (article) options I have the possibility to decide about limit of posts on each page. So for instance I decide to have a limit of 19 posts, after 19 posts will start page2 and so on.
How can I do this with category or tag page?. I could not find there this option.
I would like to reduce the articles for category pages because they are getting to big.
Thanks and greetings Thomas
Hey tom77113,
So yo want to limit the number of posts per category? If so you can add the following to functions.php:
function main_query_mods( $query ) {
if(!$query->is_main_query()) {
return;
}
// show 15 posts per page if category has id 7
// check http://codex.wordpress.org/Conditional_Tags#A_Category_Page
if ( is_category('7')) {
$query->set('posts_per_page',15);
}
}
add_action( 'pre_get_posts', 'main_query_mods' );
Best regards,
Jordan Shannon