I have a tourism site and I want to change the title
The site title is now displayed as follows :
“Activities | San Francisco, USA | My Website title”
to :
“Activities San Francisco, USA | My Website title”
This code is in the template
<title> <? php wp_title ('|', true, 'right'); ?> </title>
thanks for your help
2
Answers
Remove the seperater from the parameters. Chnage the function to this:
<title> <?php wp_title('', true); ?> </title>
The recommended way to set a title is using add_theme_support(‘title_tag’). This has to be added to the functions.php file. Then use wp_head() inside tags. Using wp_head(), auto generates the page title in WordPress. Then you can use a filter document_title_parts to filter the auto generated title of your wordpress pages. Of course you can use condition logic in side the document_title_parts filter.