Reputation: 972
I have a site here: https://www.idee-creative.co.uk Where I have added custom fields to enable me to add custom page titles and descriptions for SEO purposes.
However, the problem is, Wordpress seems to also be displaying it's own title tag containing the sites title and tagline from the general setting...
The Wordpress title must come in from the tag inside my header.php page (I think anyway).
So, is there a way to remove the wordpress page title and just show the page title I created in custom fields?
The code I use to display the custom field is just:
<title><?php the_field('seo_page_title'); ?></title>
<meta name="description" content="<?php the_field('seo_page_description'); ?>"/>
Thanks
Upvotes: 0
Views: 128
Reputation: 6004
use wp_title()
for setting the title of your page as
wp_title( string $sep = '»', bool $display = true, string $seplocation = '' )
You can get a full reference here Adding Custom Title
Upvotes: 1
Reputation: 1059
You should edit the header.php
file or modify the title tag within JavaScript (I think). You cannot override the <title>
tag within an HTML page by just placing your own after.
Hope that helped =)
Upvotes: 0