• yoryl

    (@yoryl)


    I had code for my blog page in WordPress but it shows only 6 posts and ignore the rest so pagination doesn’t work (shows just 1 page). I know that it works fine with this code but I can’t change it for my requirements.

    <?php get_header(); ?>
    
    <div class="container clearfix">
        <div id="content" class="clearfix">
            <?php
                    $postslist = get_posts('numberposts=6&order=DESC&orderby=date');
                    foreach ($postslist as $post) :
                            setup_postdata($post);
            ?>
            <div class="entry">
                    <div class="recent-post-thumbnail">
                            <?php echo the_post_thumbnail($recent->ID, 'thumbnail'); ?>
                    </div>
                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                    <?php the_excerpt(); ?>
                    <h4><a href="<?php the_permalink(); ?>">More ></a></h4>
            </div>
            <?php endforeach; ?>
      </div> <!-- end content -->
      <div class="vertical"></div>
      <div class="sidebar">
            <?php get_sidebar(); ?>
      </div>
    </div>
    <?php wp_pagenavi(); ?>
    
    <?php get_footer(); ?>
  • The topic ‘Posts per page with pagination’ is closed to new replies.