Reputation: 183
i have a wordpress site with woocommerce. My products have not only categories, but also tags. For example, i have an url like:
https://example.com/product-tag/collection-1/
And it shows me all the products with tag "collection-1". In these pages in < title > tag there is something like "collection-1 - Site Name". I want to little change the format of text in < title >, like, for example, make it "Tag: collection-1 - Site Name". I read about wp_title() hook, but how to use the title change ONLY for these "product tag" pages?
Upvotes: 0
Views: 73
Reputation: 2071
You can check this: How can I change the title on a WordPress page?
Basically that's the answer with a simple condition inside to check which page it is.
You can use is_single to check for specific pages : https://developer.wordpress.org/reference/functions/is_single/
You can use is_archives https://developer.wordpress.org/reference/functions/is_archive/
is_category() is_tag() is_author() is_date() is_post_type_archive() is_tax()
Use the one that makes sense here (which would be is_tag normally).
Upvotes: 1