Change number of posts tax and terms of custom post type
-
I’m currently using this code to display a custom number of posts on archive pages and taxonomy pages of a custom post type. I really thought this was ok, but somehow it doesn’t work.
For instance this page: https://www.dierbaardier.nl/dier/
add_action( 'pre_get_posts', 'set_posts_per_page' ); function set_posts_per_page( $query ) { if (is_tax(array('soort','ras','kruisingofbastaard'))) $query->set( 'posts_per_page', 12 ); return $query; }
- The topic ‘Change number of posts tax and terms of custom post type’ is closed to new replies.