Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function five_posts_on_category( $query ) {
- if ( $query->is_category() && $query->is_main_query() ) {
- $query->set( 'posts_per_page', 5 );
- }
- }
- add_action( 'pre_get_posts', 'five_posts_on_category' );
Advertisement
Add Comment
Please, Sign In to add comment