• Resolved brian914

    (@brian914)


    In my site, I have a custom post type. I have noticed that the when I set the “Blog pages show at most” in Settings > Reading, it also effects how many of my custom post types are showing. How can I show a very high number of posts per page in in my custom post type, but restrict my general “Blog pages show at most” to something like 10?

    Thank you for any help with this!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Digest WP

    (@jay-stankiewicz)

    Hello,

    You should check into the codex.

    $post_count
    The number of posts being displayed.

    So something like this

    $args = array(‘post_type’ => ‘<your custom post type name>’,
    ‘posts_per_page’ => 5,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘<your custom taxonomy name>’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘event-england’
    )
    )
    )

    $query = new WP_Query($args)

    Thread Starter brian914

    (@brian914)

    Thank you very much, that was exactly it!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom post type posts per page?’ is closed to new replies.