Yoast SEO
[Plugin: WordPress SEO by Yoast] Issues With og:title in CPT (5 posts)

  1. UsagiYojimbo
    Posted 4 years ago #

    Hi to all,

    Since the last update, I experience issues with og:title for custom post type. Before the update, the og_title use to show wp_title(), but since yesterday, it shows a default sentence for all custom post type :
    Example.com - a website using WordPress, while the title shown in <title></title> is still ok.

    Any suggestions ?


  2. UsagiYojimbo
    Posted 4 years ago #

    Precision :
    Wordpress 3.4
    Wordpress SEO 1.2.3
    More Types 1.2

  3. UsagiYojimbo
    Posted 4 years ago #

    I hacked the plugin and modified class-open-graph.php this way :

    public function og_title() {
    		$title = $this->title('');
    <strong>		if ( is_singular() ) {
    			global $post;
    			$title = $post -> post_title;
    		echo "<meta property='og:title' content='".esc_attr( $title )."'/>\n";

    Seems to work now. But I don't like hacking plugins

  4. wattssw
    Posted 4 years ago #

    That code gave me an error.

    Here's my solution, seems to work perfect:

    public function og_title() {
    		$title = $this->title('');
    		echo "<meta property='og:title' content='".esc_attr( get_the_title() )."'/>\n";
  5. UsagiYojimbo
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.