zmiana ilości custom postów wyświetlanych na archiwum lub
// change postperpage on custom post
function nws_custom_post_pagesize( $query ) {
if ( ! is_admin() && is_post_type_archive( 'travel' ) ) {
$query->set( 'posts_per_page', 5 );
return;
}
}
add_action( 'pre_get_posts', 'nws_custom_post_pagesize', 1 );
add_action( 'pre_get_posts', function( $query) {
if ( !is_admin() && $query->is_tax( 'where' ) ) {
$query->set( 'posts_per_page', 6 );
return;
}
} );
Hope this helps and happy coding :)