0

I have this code:

 <h1><?php the_title(); ?></h1>

That is meant to display the title of my blog post only. But because Yoast has a SEO title of something else, it is displaying that title on the page instead of the_title() eg:

It should be:

This is a title

And not what Yoast is doing:

This is a title - my site name

closed as off-topic by Michael, Jacob Peattie, bosco, nmr, fuxia Aug 7 at 9:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    That's not what the SEO title does/is for. Are you sure you haven't used wp_title() in your template by mistake? – Jacob Peattie Jul 16 at 9:37
  • Ah, yeah. I was pulling in the wrong template which was wp_title(). Thanks! – user8463989 Jul 16 at 9:40
1

That's not what the SEO title does/is for. It appears that you've used the wp_title() function in your template by mistake.

wp_title() is intended for use in the <title> tag in the <head> for setting the browser tab/document title. However, since WordPress 4.1 this has been superseded (but not officially deprecated, yet) by add_theme_support( 'title-tag' ), so these days wp_title() really shouldn't be used.

Not the answer you're looking for? Browse other questions tagged or ask your own question.