#27631 closed enhancement (duplicate)
make "comment-page" slug configurable
Reported by: | qdinar | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8 |
Component: | Comments | Keywords: | |
Focuses: | Cc: |
Description
make "comment-page" slug configurable
Attachments (2)
Change History (20)
#2
@
10 years ago
- Keywords has-patch added
The patch adds a variable named $comments_pagination_base
to the WP_Rewrite
class.
The following code modifies the 'comment-page' slug.
add_action( 'init', 'rename_comment-page_slug' ); function rename_comment-page_slug() { $GLOBALS['wp_rewrite']->comments_pagination_base = 'foobar'; }
#3
@
10 years ago
i have found a mistake here only now when i have started to read the patch. it is well known mistake in internationalisation. position of the page number should be changeable. for that "%s" code is used in internationalisation and localisation.
#4
@
10 years ago
i have been thinking and writing just now "but in this case page number position at end is at the general flow of slugs: from outer level to inner level: /year/month/day/post-name/page-number/comment-page-number/" - but this is also mistake because the slugs order may be changed in the wp-admin/options-permalink.php: there are %year% %monthnum% %day% %postname% codes are used, same code for comment slug should be added. (and also it is mistake because in the logic of the general flow from outer to inner, the page number should be separated with slash, not by hyphen).
and i have seen now, seems this slug should be configured in that place in admin area, and only something like %comment-page-num% is needed.
also post page slug should be configurable. probably new ticket should be made for this.
#5
@
10 years ago
- Keywords dev-feedback added
What is the purpose of a permalink tag for pagination? The "outer to inner" inner URL structure makes more sense.
I do not know if there was a purpose behind comment-page-n instead of comment-page/n/. Maybe a core developer can comment on this.
#6
@
10 years ago
"What is the purpose of a permalink tag for pagination?"
it is for long posts to show 1st part in the front page of the post page , then it haves 1 2 3 etc links in bottom of the post part 1 and also in bottom of post part N pages . all comments in several pages of post are same comments.
that is like unrelated to comments, but it has similar problem that slugs of it are not configurable.
#7
@
10 years ago
"Attachment 27631.2.diff added"
"$wp_rewrite->comments_pagination_base . '/' . $pagenum"
but if you look at wp-admin/options-permalink.php, it is totally configurable... "outer to inner" is just default configuration.
default is %year%/%monthnum%/%day%/%postname%
it is probably possible to make it
%postname%-written-in-%day%-of-%monthnum%-of-%year%
#8
@
10 years ago
" it is probably possible to make it
%postname%-written-in-%day%-of-%monthnum%-of-%year% "
it is possible, i have tested it now
#9
@
10 years ago
about pagination:
"On most well-coded themes, all you have to do is paste this code: <!––nextpage––> wherever you want the next page to start." - http://www.wpbeginner.com/wp-tutorials/how-to-split-wordpress-posts-into-multiple-pages/
maybe http://codex.wordpress.org/Pagination is helpful
#10
@
10 years ago
" <!––nextpage––> " - it does not work in default (built-in, official) themes (twenty eleven etc)
#12
@
9 years ago
" %postname%-written-in-%day%-of-%monthnum%-of-%year% ... it is possible, i have tested it now " - but, comments slug cannot be inside this, because it can be "void", also post pagination slug can be void. so, they should be 1) either after slash, and the slug after slash can be configurable with sprintf-like syntax, 2) either there should be several special strings with sprintf-like syntax, for cases with and without comments and post pagination, and, 2.1) they can be also several for different numbers, like in gettext...
#13
@
9 years ago
hello
i think /comment-page/n/ is good temporary fix.
@jesin
" What is the purpose of a permalink tag for pagination? "
-- it is also needed to translate it. (i have already said about changing position and customizing).
also it should/can be added to /wp-admin/options-permalink.php
and gettext functions should/can be added so that comment-page slug becomes translated automatically .
#14
@
9 years ago
i said " i think /comment-page/n/ is good temporary fix " , but it can be also left so forever, if nobody needs configuring it so that comment page number is at beginning (or middle) of address path.
Add a wp rewrite variable $comments_pagination_base