I am trying to change the content of the < title > tag if it’s shop. I leave here an example of what I have done:
function custom_title() {
if ( is_shop() ) {
// do stuff to change <title>text</title>
}
}
add_action ('wp_head', 'custom_title');
Not sure if I am in the right way. Of course I tried to change the title on the shop page, but keeps the as "Product Archives – [site title]". Also tried to use the plugin SEO by Yoast with no results.
5
Answers
I found the solution with the plugin SEO by Yoast.
Just go to "titles and meta tags" section, and then go to tab "Post types". Below there is a section with the following note: "instead of templates these are the actual titles and meta descriptions for these custom post type archive pages".
Just change the meta info on that cell and that's it.
See you!
have you tryed to make a variable $page_title make this?
This works for me:
This should work:
Try this, This will work for sure.