1

I want number pagination for single post type by post category on my custom page template, I know about next previous function but i want number pagination in my custom post page.

<?php
    // Start the loop.
    while ( have_posts() ) : the_post();

        /*
         * Include the post format-specific template for the content. If you want to
         * use this in a child theme, then include a file called called content-___.php
         * (where ___ is the post format) and that will be used instead.
         */

        ?>
        <div>
            <p><div class="socialshr"><?php echo do_shortcode('[TheChamp-Sharing]'); ?>
                    <div class="socialtitle">Comparte:</div> 
                </div>
            </p>
        </div>  

        <div class="my_post_date"><?php echo get_the_date('d/m/Y'); ?> </div>
        <h1><strong><?php echo the_title(); ?></strong></h1><?php
        get_template_part( 'content', get_post_format() );

        ?>

        <div>
            <p><div class="socialshr"><?php echo do_shortcode('[TheChamp-Sharing]'); ?>
                    <div class="socialtitle">Comparte:</div> 
                </div>
            </p>
        </div>  

    <?php

        // Previous/next post navigation.
        the_post_navigation( array(
            'next_text' => '<div class="pull-right"><span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' .
                '<span class="screen-reader-text">' . __( 'post:', 'twentyfifteen' ) . '</span> ' .
                '<span class="post-title">%title</span></div>',
            'prev_text' => '<div class="pull-left"><span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen' ) . '</span> ' .
                '<span class="screen-reader-text">' . __( 'post:', 'twentyfifteen' ) . '</span> ' .
                '<span class="post-title">%title</span></div>',
        ) );

    // End the loop.
    endwhile;
    ?>

above code for wordpress post and next/prev pagination i want number pagination for e.g 1 2 3 instead of next/prev pagination so please give me some guide how can i solve..? for custom page template..?

  • Please read How to Ask, file an edit and show us what you tried and where you failed. Thanks. – kaiser Sep 12 '16 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.