How to add pagination for wordpress home page

Question

Hi I am using thevoux theme for my website as i need to add pagination links like “Older Posts and Newer Posts” to home page.Here is an example screen shot how it should be.
enter image description here

Actually right now i am getting these links in menus in the same way i need to display them in home page as well.

<?php get_header(); ?>
<?php 
$blog_featured = ot_get_option('blog_featured');
?>
<?php if ($blog_featured) { ?>
<div class="row header_content">
    <div class="small-12 columns">
        <?php 
            $args = array(
                'p' => $blog_featured,
                'post_type' => 'any'
            );
            $featured_post = new WP_Query($args);
        ?>

        <?php if ($featured_post->have_posts()) :  while ($featured_post->have_posts()) : $featured_post->the_post(); ?>
        <?php get_template_part( 'inc/loop/blog-featured' ); ?>
        <?php endwhile; else : endif; ?>
    </div>
</div>  
<?php } ?>

<div class="row">
<section class="blog-section small-12 medium-8 columns">
    <div class="row" data-equal=">.columns">
        <?php if (have_posts()) :  while (have_posts()) : the_post(); ?>
            <?php get_template_part( 'inc/loop/blog-list' ); ?>
        <?php endwhile; else : ?>
            <?php get_template_part( 'inc/loop/notfound' ); ?>
        <?php endif; ?>
    </div>
    <?php if ( get_next_posts_link() || get_previous_posts_link()) { ?>
    <div class="blog_nav">
        <?php if ( get_next_posts_link() ) : ?>
            <a href="<?php echo next_posts(); ?>" class="next"><i class="fa fa-angle-left"></i> <?php _e( 'Older Posts', 'thevoux' ); ?></a>
        <?php endif; ?>

        <?php if ( get_previous_posts_link() ) : ?>
            <a href="<?php echo previous_posts(); ?>" class="prev"><?php _e( 'Newer Posts', 'thevoux' ); ?> <i class="fa fa-angle-right"></i></a>
        <?php endif; ?>
    </div>
    <?php } ?>
</section>
<?php get_sidebar(); ?>
</div>
0
, Ashalatha 6 years 2017-01-11T06:24:09-05:00 0 Answers 73 views 0

Leave an answer

Browse
Browse