• Resolved Mr_hero

    (@mr_hero)


    Hello My website is SolarMovie , I just wanna change the og:type = Article to og:type = Movie since all the pages contains movies only. Please help me to do it.

    I am using wordpress seo by yoast.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • This may require some coding.

    You can find the WordPress Seo API documentation here: WordPress SEO API Docs

    There’s also an example shown: (code goes in you functions.php)

    function yoast_change_opengraph_type( $type ) {
      if ( is_page( 'X' ) )
        return 'video';
    }
    add_filter( 'wpseo_opengraph_type', 'yoast_change_opengraph_type', 10, 1 );

    You’d probably check for the post type like:

    if ( is_singular( 'video' ) ) {
    return 'video';
    }
    Thread Starter Mr_hero

    (@mr_hero)

    I did it successfully, i just changed serched for the keyword og:type on opengraph.php file then just above it it says $type=Article i changed it to Movie 🙂 and all the posts are now type movie.

    (No coding required to do it)

    Thanks anyway

    If you update (which you should) your change will be lost.

    miketopher

    (@miketopher)

    How can i do this for regular posts?

    I did

    function yoast_change_opengraph_type( $type ) {
      if ( is_post() )
        return 'video';
    }
    add_filter( 'wpseo_opengraph_type', 'yoast_change_opengraph_type', 10, 1 );

    and get this error
    Fatal error: Call to undefined function is_post() in /home/mysite/public_html/updates/wp-content/themes/bgtheme/functions.php on line 5

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change og:type? its wordpress seo by yoast’ is closed to new replies.