Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #27338

    Please refer this image

    remove that previous and next button for post

    add next and previous button at footer of the post.

    Like this image



    Delete or comment out following line in footer.php

    echo avia_post_nav();

    Best regards,



    thanks for replying me but what i have to do for second part.

    I am also want to add next/previous button at the end of the post how can i do this.

    check this link



    Edit single.php, find this code:

    get_template_part( 'includes/loop', 'index' );

    Replace it with:

    get_template_part( 'includes/loop', 'index' ); ?>

    <div class='post_nav'>
    <div class='previous_post_link_align'>
    <?php previous_post_link('<span class="previous_post_link">&larr; %link </span>'); ?>
    <div class='next_post_link_align'>
    <?php next_post_link('<span class="next_post_link">%link &rarr;</span>'); ?>
    </div> <!-- end navigation -->


    Add this on your custom.css or Quick CSS:

    .previous_post_link_align {
    float: left;

    .next_post_link {
    float: right;
    clear: none;




    Thankyou Ismael for reply.

    I have tried your solution so that worked but previous and next button for post is not in order.

    So can you tell me how can i make it in order



    What do you mean by “it is not in order”? Are they not positioned properly?




    I think you have suggest me on the basis of post has been posted.

    So next and previous buttons are sets on the basis of date of post.

    so because of this the order of previous and next is not in order



    Found this solution. This will filter the sorting order by title. Add this on your functions.php

    function filter_next_post_sort($sort) {
    $sort = "ORDER BY p.post_title ASC LIMIT 1";
    return $sort;
    function filter_next_post_where($where) {
    global $post, $wpdb;
    return $wpdb->prepare("WHERE p.post_title > '%s' AND p.post_type = 'post' AND p.post_status = 'publish'",$post->post_title);

    function filter_previous_post_sort($sort) {
    $sort = "ORDER BY p.post_title DESC LIMIT 1";
    return $sort;
    function filter_previous_post_where($where) {
    global $post, $wpdb;
    return $wpdb->prepare("WHERE p.post_title < '%s' AND p.post_type = 'post' AND p.post_status = 'publish'",$post->post_title);

    add_filter('get_next_post_sort', 'filter_next_post_sort');
    add_filter('get_next_post_where', 'filter_next_post_where');

    add_filter('get_previous_post_sort', 'filter_previous_post_sort');
    add_filter('get_previous_post_where', 'filter_previous_post_where');



Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘How to Customize previous and next button in post?’ is closed to new replies.