Home / Admin / Taxonomy Count
Duplicate Snippet

Embed Snippet on Your Site

Taxonomy Count

Control the number of products displayed on the default download category and download tag pages.

Code Preview
php
<?php
// adjust downloads taxonomy loop
function custom_download_tag_count( $query ) {
	if ( ( $query->is_tax( 'download_category' ) || $query->is_tax( 'download_tag' ) ) && ! is_admin() && $query->is_main_query() ) {
		// replace 15 with desired amount
		$query->set( 'posts_per_page', 15 );
	}
}
add_action( 'pre_get_posts', 'custom_download_tag_count' );

Comments

Add a Comment