Support » Plugin: Open Graph for Facebook, Google+ and Twitter Card Tags » Possible Integration with The SEO Framework

  • Hello,

    I love the interface of this plugin, as well as that of The SEO Framework, and I think the two can greatly compliment each other for handling SMO and SEO together. However, your plugin doesn’t work with the titles and descriptions set using The SEO Framework. I spoke to the author of that plugin on the subject of integration, and he offered a couple of great options. He also suggested that I refer you to his solution so that you can take a look and consider a possible integration. Here’s the link to his reply:

    https://wordpress.org/support/topic/sitemap-not-working-5/#post-8489943

    Here’s his response there, for anyone who wouldn’t wanna visit the link above:

    ————-Begin response————-

    The integration you’re speaking off can be achieved with either of the following code snippet.
    If you’re unfamiliar with placing code snippets, please refer to this guide.

    Pick either #1 or #2, not both:

    #1: Only take values from The SEO Framework’s SEO Settings metabox (post/page only).

    add_filter( 'fb_og_title', 'my_fb_title_alterations' );
    function my_fb_title_alterations( $previous = '' ) {
    
    	$tsf = function_exists( 'the_seo_framework' ) ? the_seo_framework() : null;
    	if ( is_object( 'the_seo_framework' ) ) {
    		$title = the_seo_framework()->get_custom_field( '_genesis_title' );
    	}
    
    	//* Determine if a custom title has been set up. Otherwise; fall back to Webdados'.
    	$title = $title ? $title : $previous;
    
    	return $title;
    }
    
    add_filter( 'fb_og_desc', 'my_fb_desc_alterations' );
    function my_fb_desc_alterations( $previous = '' ) {
    
    	$tsf = function_exists( 'the_seo_framework' ) ? the_seo_framework() : null;
    	if ( is_object( 'the_seo_framework' ) ) {
    		$desc = the_seo_framework()->get_custom_field( '_genesis_description' );
    	}
    
    	//* Determine if a custom description has been set up. Otherwise; fall back to Webdados'.
    	$desc = $desc ? $desc : $previous;
    
    	return $desc;
    }

    #2 Get any title and description made by The SEO Framework, even the automated versions:

    add_filter( 'fb_og_title', 'my_fb_title_alterations' );
    function my_fb_title_alterations( $previous = '' ) {
    
    	$tsf = function_exists( 'the_seo_framework' ) ? the_seo_framework() : null;
    	if ( is_object( 'the_seo_framework' ) ) {
    		//* 'true' means that it will bypass the WordPress theme title checks.
    		$title = the_seo_framework()->title_from_cache( '', '', '', true );
    	}
    
    	//* Determine if a custom title has been set up. Otherwise; fall back to Webdados'.
    	$title = $title ? $title : $previous;
    
    	return $title;
    }
    
    add_filter( 'fb_og_desc', 'my_fb_desc_alterations' );
    function my_fb_desc_alterations( $previous = '' ) {
    
    	$tsf = function_exists( 'the_seo_framework' ) ? the_seo_framework() : null;
    	if ( is_object( 'the_seo_framework' ) ) {
    		//* 'true' means it will get a longer, social version of the description.
    		$desc = the_seo_framework()->description_from_cache( true );
    	}
    
    	//* Determine if a custom description has been set up. Otherwise; fall back to Webdados'.
    	$desc = $desc ? $desc : $previous;
    
    	return $desc;
    }

    I hope this helps :). And if you’d like, you can refer the plugin authors of “Facebook Open Graph, Google+ and Twitter Card Tags” to this reply as to see how to easily get data from The SEO Framework.

    ————–End response————–

    Looking forward to your response.

  • The topic ‘Possible Integration with The SEO Framework’ is closed to new replies.