roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.71k stars 3.06k forks source link

Display CPT label in title instead of default #3136

Closed eduardoarandah closed 1 year ago

eduardoarandah commented 1 year ago

Given a CPT "Pets"

Instead of "Archives: Pets", show "Pets"

image image

How to test

the usual install

git clone git@github.com:roots/sage.git && cd sage
composer require roots/acorn
composer install
yarn && yarn build
wp theme activate sage

add ui for post types

wp plugin install --activate custom-post-type-ui

add pet cpt

add post type

add a dog and a cat

navigate to archive

example:

http://wp.localhost/pet/

retlehs commented 1 year ago

Take a look at using the get_the_archive_title filter instead