devinsays / portfolio-press

A WordPress theme for artists and designers to showcase their work.
https://wptheming.com/portfolio-theme/
GNU General Public License v2.0
62 stars 30 forks source link

Posts Per Page on Portfolio Taxonomies #20

Closed devinsays closed 12 years ago

devinsays commented 12 years ago

function wpt_portfolio_custom_posts_per_page( $query ) { global $wp_the_query; if ( $wp_the_query === $query && !is_admin() && is_post_type_archive( 'portfolio' ) ) { $query->set( 'posts_per_page', '9' ); } }

devinsays commented 12 years ago
/**
 * Sets posts displayed per portfolio page to 9
 */
function wpt_portfolio_custom_posts_per_page( $query ) {
    global $wp_the_query;
    if ( $wp_the_query === $query && !is_admin() ) {
        if ( is_post_type_archive( 'portfolio' ) || is_tax( 'portfolio_tag' ) ||  is_tax( 'portfolio_category' ) )
            $query->set( 'posts_per_page', '9' );
    }
}