Forum Replies Created

Viewing 1 replies (of 1 total)
  • To show multiple posts you need to change the $query_string global variable for the loop running.

    Use the function query_posts() before the loop like this:

    <!-- Changes the query_string for the front page. -->
    <?php query_posts( 'posts_per_page=3&cat=13' ); ?>
        <?php if ( have_posts() ) : ?>
            <?php /* The loop */ ?>
            <?php while ( have_posts() ) : the_post(); ?>
                <?php get_template_part( 'content', get_post_format() ); ?>
            <?php endwhile; ?>
        <?php else : ?>
            <?php get_template_part( 'content', 'none' ); ?>
        <?php endif; ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Read This – https://codex.www.ads-software.com/Function_Reference/query_posts

Viewing 1 replies (of 1 total)