Title: Custom post pagination single.php
Last modified: September 1, 2016

---

# Custom post pagination single.php

 *  [vilto](https://wordpress.org/support/users/vilto/)
 * (@vilto)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/custom-post-pagination-singlephp/)
 * Hello,
 * I would like to customize the pagination of my post when I split them with the
   <!––nextpage––> tag.
 * I have the default 1,2,3,4 next
 * I would like : Previous 2/10 Next
 * I don’t know what to change in single.php : The concerned lines are
 * `<?php wp_link_pages(array('before' => '<div class="pagination">', 'after' =>'
   </div>', 'link_before' => '<span class="current"><span class="currenttext">','
   link_after' => '</span></span>', 'next_or_number' => 'next_and_number', 'nextpagelink'
   => __('Next', 'sociallyviral' ), 'previouspagelink' => __('Previous', 'sociallyviral'),'
   pagelink' => '%','echo' => 1 )); ?>`
 * Here is a website using a custom post pagination : [http://amazetify.com/entertainment/33-perfectly-timed-photos/32/](http://amazetify.com/entertainment/33-perfectly-timed-photos/32/)
 * Thank you for your help !

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MyThemeShop](https://wordpress.org/support/users/mythemeshop/)
 * (@mythemeshop)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/custom-post-pagination-singlephp/#post-7615054)
 * Hi,
    Please create a child theme and add this code to its functions.php file:
 *     ```
       add_action( 'after_setup_theme', 'mts_change_post_pagination' );
       function mts_change_post_pagination() {
           remove_filter( 'wp_link_pages_args', 'mts_wp_link_pages_args' );
           add_filter( 'wp_link_pages_args', 'mts_wp_link_pages_args_new' );
       }
       function mts_wp_link_pages_args_new( $args ) {
           global $page, $numpages, $more, $pagenow;
           $args['next_or_number'] = 'next';
           $args['after'] = '<span class="pagination-count">'."$page / $numpages".'</span></div>';
           return $args;
       }
       ```
   
 * Additionally, you may need some custom CSS code if the appearance of the new 
   pagination isn’t right.
    Hope that helps.
 *  [fk59](https://wordpress.org/support/users/fk59/)
 * (@fk59)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/custom-post-pagination-singlephp/#post-7615233)
 * Hi Vilto,
 * thx, this code works fine for me.
 * 2 questions:
 * How can i put a VIEW ALL link?
 * Is it possible to place images as buttons?
 * Thx very much
 * Frank

Viewing 2 replies - 1 through 2 (of 2 total)

 The topic ‘Custom post pagination single.php’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [navigation](https://wordpress.org/support/topic-tag/navigation/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [fk59](https://wordpress.org/support/users/fk59/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/custom-post-pagination-singlephp/#post-7615233)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
