Title: Add Next Button
Last modified: July 22, 2020

---

# Add Next Button

 *  Resolved [ammadali](https://wordpress.org/support/users/ammadali/)
 * (@ammadali)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/add-next-button/)
 * I want to add Next article button in the bottom of AMP page.
    Example: [https://indianexpress.com/article/world/coronavirus-global-updates-22-july-us-mexico-brazil-russia-china-6517751/lite/](https://indianexpress.com/article/world/coronavirus-global-updates-22-july-us-mexico-brazil-russia-china-6517751/lite/)

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

 *  [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/add-next-button/#post-13156894)
 * [@ammadali](https://wordpress.org/support/users/ammadali/) If looking to implement
   pagination for your reader mode AMP URLs you can add the below to your current
   reader mode templates.
    `<?php the_post_navigation(); ?>`
 * An ideal placement would be within the single.php template.
 * You can then add the below to your themes functions.php to ensure each links 
   directs users to their AMP version:
 *     ```
       add_filter( 'post_link', function( $url, $post ) {
       	static $recursing = false;
       	if ( $recursing ) {
       		return $url;
       	}
       	$recursing = true;
       	if ( ! function_exists( 'post_supports_amp' ) || ! post_supports_amp( $post ) ) {
       		return $url;
       	}
       	if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && post_supports_amp( $post ) ) {
       		$url = amp_get_permalink( $post->ID );
       	}
       	$recursing = false;
       	return $url;
       }, 10, 2 );
       ```
   
 * You’ll need to style the links to suit your needs. You’ll find more on pagination
   with some examples [here](https://developer.wordpress.org/reference/functions/the_post_navigation/).
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/add-next-button/#post-13157179)
 * Actually, as opposed to using the `post_link` filter, you can instead just enable
   AMP-to-AMP linking, which is disabled by default in Reader mode.
 * You can enable it with this code:
 * `add_filter( 'amp_to_amp_linking_enabled', '__return_true' );`
 * Then the Next/Previous links should automatically link to the AMP versions.

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

The topic ‘Add Next Button’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/add-next-button/#post-13157179)
 * Status: resolved