Make WordPress Core

Opened 3 years ago

Closed 20 months ago

Last modified 20 months ago

#20844 closed feature request (wontfix)

Specify titles using <!-- nextpage -->

Reported by: sgr33n Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:



I'm planning to code a plugin but maybe you're going to code it into WP core, so I prefer to ask before.

The idea is to modify <!-- nextpage --> code in order to give a title to every page, also better in SEO to have an url like www.wordpress.org/2012/my-article and www.wordpress.org/2012/my-article/conclusion/ instead of www.wordpress.org/2012/my-article/2/.

Maybe is possible to modify it this way: <!-- nextpageConclusion? -->

It's different from subpages because it will be usable on every post type, not even on pages, and you will create just one post, not more.

Last but not least you could have a page selector with titles not page numbers.

Thanks :)

Change History (19)

comment:1 @sgr33n3 years ago


<!-- nextpage['Conclusion'] --> 

comment:2 @scribu3 years ago

  • Summary changed from <!-- nextpage --> to Specify titles using <!-- nextpage -->

comment:3 follow-up: @scribu3 years ago

Why not use a shortcode instead?

[nextpage title=Conclusion]

comment:4 in reply to: ↑ 3 @DrewAPicture3 years ago

  • Cc xoodrew@… added

Replying to scribu:

Why not use a shortcode instead?

[nextpage title=Conclusion]

+1 for the shortcode.

comment:5 @arieputranto3 years ago

../my-article/conclusion : maybe using WP_Rewrite?
Title for it : How about post_meta?

comment:6 @sgr33n3 years ago

Maybe good using shortcodes but in this case you need to insert two lines of code. With the

<!-- nextpage --> 

Syntax first you can preserve legacy, then you can use just one line of code.

comment:7 @scribu3 years ago

My thought was that [nextpage] could also handle the splitting, so you would still only need one line of code.

comment:8 @sgr33n3 years ago

So leave intact nextpage and create a shortcode duplicate to split with titles?
Sounds good :)

comment:9 follow-up: @sgr33n3 years ago

Update: I'm coding it as shortcode, even if it is not really a shortcode because you cannot handle it using add_shortcode... anyway, I'm asking why using


It returns the link www.site.com/2012/06/title/page/nextpagetitle, and if I use the regular
nextpage the link is www.site.com/2012/06/title/nextpagetitle, even if the core function uses $wp_rewrite->pagination_base

? :P

Last edited 3 years ago by sgr33n (previous) (diff)

comment:10 in reply to: ↑ 9 @duck_3 years ago

Replying to sgr33n:

The pagination_base is used for paging of archives (e.g. category archives or date archives). It is not used for pagination of single posts or pages with multiple pages.

comment:11 @sgr33n3 years ago

Thanks Duck,

Nevertheless, reading the code it seems that WP calls pagination_base also for single posts:
From wp-includes/link-template.php (line 1422)

function get_pagenum_link($pagenum = 1, $escape = true ) {

		if ( $pagenum > 1 ) {
			$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );


comment:12 @sgr33n3 years ago

Almost complete, just time to solve some permalink issues that are driving me crazy o.O

Last edited 3 years ago by sgr33n (previous) (diff)

comment:13 @sgr33n3 years ago

Everything works now, even url rewrites but maybe something is wrong because even if I call a page like www.site.com/2012/06/posttitle/pagetitle/dasdsadas/dasdasdas/dasdsadsa/ WP returns the page, not even the 404 o.O can somebody help?

comment:14 @sgr33n3 years ago

I'm proud to annunce that my first public WP Plugin is released in the first beta version :)


comment:15 @scribu3 years ago

I took a look at your code and I think you could actually rely on the shortcode parsing and the old nextpage tag:

function nextpage_shortcode( $attr ) {
  $global $nextpage_shortcodes;

  $nextpage_shortcodes[] = $attr['title'];

  return '<!--nextpage-->';  // Let WP handle splitting the content
add_shortcode( 'nextpage', 'nextpage_shortcode' );

Later, you can use the $nextpage_shortcodes global array to figure out which title to show.

comment:16 @sgr33n3 years ago

Thanks for the suggestion :)
Maybe you can help me solving the infinite / and 404 not showing problem?

comment:17 @sgr33n3 years ago

Anyway I tried your suggestion... my impression is that Wordpress handles the


Code before it handles shortcodes, so in this way you can see the not handle code in the post.

Version 0, edited 3 years ago by sgr33n (next)

comment:18 @c3mdigital20 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

Cool looks like your plugin takes care of this. Closing as wont fix.

comment:19 @DrewAPicture20 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.