WordPress.org

Make WordPress Core

Opened 14 months ago

Last modified 6 months ago

#42768 new enhancement

the_archive_title clutter

Reported by: beerwin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.1
Component: General Keywords: needs-patch
Focuses: ui, template Cc:

Description

This function (and its get_ counterpart) is adding the "Archives:" prefix to the archive title. While the reason for this is understandable, not every site is a news/blog site, and many of us wishes to remove this (as it is clutter for some presentation sites, where we use standard WordPress behavior and custom post types for listing things).

This function is very useful, as it works with any kind of archives. However, the clutter isn't.

It's OK to leave the feature in by default. The only thing that is needed, to add a parameter which we can use to turn it off (using false).

For example:

the_archive_title($before = '', $after = '', $use_title_prefix = true);

Change History (4)

#2 in reply to: ↑ 1 @beerwin
14 months ago

Replying to Presskopp:

I think this could be filtered like

https://gist.github.com/proweb/f329cde740e0802870871bef830fab50

Yes, that is pretty much the kind of duplicate code I would like to avoid, given how the clutter is being added in get_the_archive_title(). Calling single_cat_title() twice to just get the archive title without the clutter. And single_cat_title() has a somewhat deep call stack on its own. Right now, we are undoing something that has been done 2 ms earlier by rerunning almost the same thing.

I'm not asking to remove these title prefixes. It's just a request to make them optional. Aside of being less work for theme developers, it's also a bit less work for servers to do. Also, my suggestion won't break backwards compatibility either.

#3 @GaryJ
13 months ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.