-
-
Save tommcfarlin/f2310bfad60b60ae00bf to your computer and use it in GitHub Desktop.
[WordPress] An example of an easy way to check if a post is paginated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( acme_is_paginated_post() ) { ?> | |
<div class="post-pagination"> | |
<?php wp_link_pages(); ?> | |
</div><!-- .post-pagination --> | |
<?php } // end if ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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