[wp-trac] [WordPress Trac] #37260: Request: Functions to check if there's a 2nd page

WordPress Trac noreply at wordpress.org
Sun Jul 3 11:20:04 UTC 2016


#37260: Request: Functions to check if there's a 2nd page
--------------------------+-----------------------------
 Reporter:  henry.wright  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.5.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Sometimes it's useful to wrap a pagination function in HTML:

 {{{<nav><?php some_wp_pag_function(); ?></nav>}}}

 But if there's no 2nd page, we're left with markup such as:

 {{{<nav> </nav>}}}

 It would be useful to have a set of functions available which check if
 there's a 2nd page so we could do stuff like this:

 {{{
 if ( is_there_a_second_page() ) { ?>
     <nav><?php some_wp_pag_function(); ?></nav>
 <?php }
 }}}

 Things that can be paginated which spring to mind are:

  - Posts
  - Comments
  - A single post via {{{<!-- nextpage -->}}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37260>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list