•                                     <?php /* Start the Loop */ ?>
                                        <?php while (have_posts()) : the_post(); ?>
    
                                            <?php
                                                if ($front == 'posts') :
                                                    get_template_part('template-parts/content-blog', get_post_format());
                                                else:
                                                    get_template_part('template-parts/content-page-home', get_post_format());
                                                endif;
                                            ?>
    
                                        <?php endwhile; ?>

    Set while to only show most recent 6 posts.

    How do I change the have posts to show most recent 6 posts?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You cannot change it there. It needs to be set in the “posts_per_page” argument for WP_Query. Where that is done depends on what query this loop is running for. It appears to be a main query, so go to the reading settings in the admin area and set “Blog pages show at most” to 6.

Viewing 1 replies (of 1 total)
  • The topic ‘Set While to defined number’ is closed to new replies.