fbpx

Filtering archive pages headings in WordPress 5.5

GET UP TO $500K IN BUSINESS FUNDING

With WordPress 5.5, theme authors will now be able to easily filter archive pages headings, so they can use their own HTML markup.

The existing get_the_archive_title hook was previously limited to filter the whole title string used on archive pages. Some contributors pointed out that this filter was not specific enough to address all theme developers needs related to the archive pages headings.

In get_the_archive_title() this change splits the internal $title variable into $title and $prefix.

By using the new get_the_archive_title_prefix filter, the prefix can now be wrapped within custom elements or removed completely.

Basic examples

get_the_archive_title_prefix can be used to filter the archive pages heading prefix. It accepts

BUILD A WEBSITE: RESOURCES

Pin It on Pinterest

Share This
Xiphos Web Marketing

FREE
VIEW