[wp-trac] [WordPress Trac] #29808: Post/paging navigation template tags
WordPress Trac
noreply at wordpress.org
Tue Sep 30 12:59:02 UTC 2014
#29808: Post/paging navigation template tags
-------------------------+-------------------------
Reporter: obenland | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.1
Component: Themes | Version: trunk
Severity: normal | Keywords: 2nd-opinion
Focuses: template |
-------------------------+-------------------------
When default themes have to create their own functions to polyfil template
tags, it's usually a good indicator that this is an opportunity for Core
to make the lives of theme developers easier. An example for that would be
the navigational template tags that have been in use since Twenty Ten.
Today, we not only see them in core bundled themes. Through forking
default themes and building off of starter themes, a lot of themes in the
Repository also use similarly structured template tags.
**Post Navigation**
Post navigation markup has not changed a lot since Twenty Ten. Eventually
default themes wrapped it in its own function, but the output basically
remained the same.
**Paging Navigation**
Like post navigation links to the previous/next post, the paging
navigation links to the previous/next set of posts. With the exception of
HTML5 support and a11y improvements, the tag has not changed since Twenty
Ten.
It is something every theme has to implement one way or the other, which
is why we have `get_posts_nav_link()` and `posts_nav_link()`. We should
probably think about deprecating them.
**Pagination Navigation**
Out of the default themes, only Twenty Fourteen has used a pagination so
far. Given the download numbers of plugins like [https://w.org/plugins/wp-
pagenavi WP Page-Navi], and our plugin-first approach however, a strong
case can be made for the need of a pagination tag in core.
With the most recent improvements to `paginate_links()` (r28785, r29780),
a pagination template tag would be **a lot** less involved than it had to
be [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
content/themes/twentyfourteen/inc/template-tags.php#L10 in Twenty
Fourteen]. It could basically just accept an arguments array that would be
passed to `paginate_links()`, check if there are links, and then returns
them wrapped in `<nav>` elements.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29808>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list