Pagination menu like in home page of sparkling

Please, tell about realization of button “Older posts” which show previous posts, is it a plugin or function of theme? How I can do the button on my site?

Hi @Fynfastik,

I hope you are well today and thank you for your question.

The button “Older posts” which shows previous posts is developed in a Sparkling theme using the following builtin WordPress function next_posts_link and developing custom CSS code to style it as button.

http://codex.wordpress.org/Function_Reference/next_posts_link

You can develop a similar button on your site by using the above function and styling it developing CSS code.

Please advise if you have more questions.

Cheers,
Vinod Dalvi

Thanks! But I use theme “sparkling”, how can I call this button?

I’m interested button which are not reload page, like this: https://colorlib.com/sparkling/

Just one button, which load new page

Ok, JetPack has options for setting such button on the main page, but what about another pages, if I have done show posts on not main page, it’s my own file of template which like separated archives.php, only without <header>…</header> part and with query_posts() for loop. Why aren’t button “Older posts” showed there? My be it needs special call?

it’s code of page, where the button is not showed, but buttons “Newer posts” & “Older posts” are.

get_header(); ?>

    <section id="primary" class="content-area">
        <main id="main" class="site-main" role="main">

            <?php if ( have_posts() ) : ?>

                <?php /* Start the Loop for this Page Content */ ?>
                <?php while ( have_posts() ) : the_post(); ?>
                    <?php
                    get_template_part( 'content-top', get_post_format() ); //Show this page content
                    wp_reset_postdata(); //Reset POST
                    ?>
                <?php endwhile; ?>

                <?php /* Start the Loop for */ ?>
                <?php query_posts(array(
                    'category__in' => array(1, 4, 5),
                )); ?>
                <?php while ( have_posts() ) : the_post(); ?>
                    <?php
                    /* Include the Post-Format-specific template for the content.
                     * If you want to override this in a child theme, then include a file
                     * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                     */
                    get_template_part( 'content', get_post_format() );
                    ?>

                <?php endwhile; ?>

                <?php sparkling_paging_nav(); ?>

            <?php else : ?>

                <?php get_template_part( 'content', 'none' ); ?>

            <?php endif; ?>

        </main><!-- #main -->
    </section><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>