Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Determines whether or not the current post is a paginated post.
- * @return boolean True if the post is paginated; false, otherwise.
- */
- function acme_is_paginated_post() {
- global $multipage;
- return 0 !== $multipage;
- }
- ?>
- <?php if ( acme_is_paginated_post() ) { ?>
- <div class="post-pagination-toc">
- <!-- paginated post TOC display that checks headers across different poages and the displays all headers in as TOC's content uniformly across all paginated pages -->
- </div>
- <?php else { ?>
- <div class="normal-singlepage-toc">
- <!-- normal TOC display for single non-paginated post -->
- </div>
- <?php } ?>
- <?php
- function TOC_new () {
- global $numpages;
- if ( is_singular() && $numpages > 1 ) {
- // This is a single post
- // and has more than one page;
- // Implement a General TOC to be displayed consistently multiple Pages and return values
- } else {
- // This is a single post
- // and has only one page;
- // implement TOC code for single pages.
- }
- ?>
- function wpse_check_multi_page()
- {
- $num_pages = substr_count(
- $GLOBALS['post']->post_content,
- '<!--nextpage-->'
- ) + 1;
- $current_page = get_query_var( 'page' );
- return array ( $num_pages, $current_page );
- }
- Array
- (
- [0] => 3
- [1] => 2
- )
- Array
- (
- [0] => 1
- [1] => 0
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement