Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posts Per Page on Portfolio Taxonomies #20

Closed
devinsays opened this issue Mar 7, 2012 · 1 comment
Closed

Posts Per Page on Portfolio Taxonomies #20

devinsays opened this issue Mar 7, 2012 · 1 comment

Comments

@devinsays
Copy link
Owner

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
Copy link
Owner Author

/**
 * 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' );
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant