• Resolved raws4581

    (@raws4581)


    I am trying to list only a certain amount of work porfolios on my front page, right now the code list all. I only want to list 6 so I am using posts_per_page but is not working. Any help would be appreciated.

    Here is the code:

    <?php
    $args = array(
    	'nopaging' => true,
    	'post_type' => 'portfolio',
    	'posts_per_page' => 6,
    	'orderby' => array('menu_order' => 'ASC', 'ID' => 'ASC')
    );
    $wp_query = new WP_Query($args);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    	get_template_part('loop', 'portfolio');
    	endwhile;
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘post per page’ is closed to new replies.