Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin tommcfarlin/index.php Secret
Created Dec 17, 2013

Embed
What would you like to do?
[WordPress] An example of an easy way to check if a post is paginated.
<?php if ( acme_is_paginated_post() ) { ?>
<div class="post-pagination">
<?php wp_link_pages(); ?>
</div><!-- .post-pagination -->
<?php } // end if ?>
<?php
/**
* Determines whether or not the current post is a paginated post.
*
* @return boolean True if the post is paginated; false, otherwise.
* @package includes
* @since 1.0.0
*/
function acme_is_paginated_post() {
global $multipage;
return 0 !== $multipage;
} // end acme_is_paginated_post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.