WordPress.org

Ready to get started?Download WordPress

Forums

SEO Title Coding (8 posts)

  1. LinGreg
    Member
    Posted 2 years ago #

    I have installed Yoast SEO and am trying to set up the Titles section correctly by inserting <title><?php wp_title(''); ?></title> rather than forcing the rewrite which I understand slows the site down.(As an aside is that true?)

    My problem is I cant see where in the Header.php I need to put the code. My website is http://www.bowentherapysussex.com, I am using the Weaver theme.

    It would be really helpful if anyone could show me where in the header code I should insert the above. Many thanks

  2. Fire Truck
    Member
    Posted 2 years ago #

    Look in the file hdr-title.php

  3. LinGreg
    Member
    Posted 2 years ago #

    Ok thanks for getting back to me zmv - this is the code in that file:

    [code moderated - please use the pastebin for any code over the forum limit of 10 lines]

    Where would I paste the <title><?php wp_title(''); ?></title> code in this?

    BTW- I am a complete novice as if you hadn't guessed!

  4. Fire Truck
    Member
    Posted 2 years ago #

    Apparently you have to replace everything between <title> and </title> with <?php wp_title(''); ?>

  5. Peter Wooster
    Member
    Posted 2 years ago #

    It looks like your theme has an option to hide its meta tags. If you set that option it will use the wp_title function. So you don't need to add any code, just set that option.

    /Peter

  6. LinGreg
    Member
    Posted 2 years ago #

    Hi Peter
    I've gone to the option I think you're talking about and ticked the box for using SEO instead of the weaver metatags. The code in the hdr.php now shows as follows:

    [code moderated - please use the pastebin for any code over the forum limit of 10 lines]

    Does that look right?

    Thank you both so much for your help .

  7. LinGreg
    Member
    Posted 2 years ago #

    Sorry moderator - didn't know about paste bin - have pasted code in under LinGreg - its public and at http://pastebin.com/ShZfvmLw
    Hopefully you can see the new hdr.php code - is that now ok?

  8. Peter Wooster
    Member
    Posted 2 years ago #

    The code doesn't change when you set that option, what charges is the function that gets called. Try using some of the Yoast SEO settings and see if the meta fields appear in the HTML source.
    /Peter

Topic Closed

This topic has been closed to new replies.

About this Topic