Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi Shaikh Masood Alam,

    From the Google+ Snippet documentation, it seems everything has already been set up generously for Google+.

    However, I do also see this issue coming up on The SEO Framework’s website’s Homepage. This is because the image isn’t optimized for Google+.
    When I remove the image, the description is then shown.
    Google+ makes up its own mind in how the snippet is displayed, and I have to adjust, of course.

    In version 2.7.0 my focus will be on image sharing, I will definitely keep this in mind so images will be shown correctly on all social networks.

    For the Title, I’m unsure what causes that. Do you have a link to your homepage for me? Thanks!

    I hope this clears things up! Stay tuned for further progression, this plugin is fairly new :). Have a great day!

    Thread Starter Shaikh Masood Alam

    (@masoodalam51)

    I use the same site for testing Google+ issue, before this plugin Yoast SEO display correct description and image but this plugin wont.
    Check:
    www.techelex.org and bloggyaani.com/

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Shaikh Masood Alam,

    Thanks for the information, I can see no description is showing up, even if I were to remove the image from the snippet.

    Below is a little snippet that adds a microdata description to The SEO Framework output. Would you care to try it out and see if the results change?

    Please keep in mind that many social networks cache the snippets, so I suggest trying a yet-to-be-discovered page to find the correct results.

    Also be sure to clear your object cache prior to testing, if applicable.

    add_filter( 'the_seo_framework_after_output', 'my_itemprop_description_init', 11 );
    /**
     * Special filter to keep adding onto The SEO Framework.
     *
     * @param array $functions All the hooked functions.
     * @return array $functions The hooked functions.
     */
    function my_itemprop_description_init( $functions ) {
    
    	$functions[] = array(
    		'callback' => array( 'my_itemprop_description_output' ),
    	);
    
    	return $functions;
    }
    
    /**
     * Output Google+ Social Description.
     *
     * @return string The Google+ description.
     */
    function my_itemprop_description_output() {
    
    	//* Call the class.
    	$the_seo_framework = the_seo_framework();
    
    	//* Get the social description. Already escaped.
    	$description = $the_seo_framework->description_from_cache( true );
    
    	return '<meta itemprop="description" content="' . $description . '" />' . "\r\n";
    }

    I hope this helps! Let me know if it all works out :).

    Thread Starter Shaikh Masood Alam

    (@masoodalam51)

    Its works for description but still show site title as a Post title.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Shaikh Masood Alam,

    That’s great to hear!

    I just need to convert it into a LD+Json script then for 2.7.0 :), as not all themes allow support for the used tag. The same also counts for the Title, which is shown below.

    To become the early adopter, here’s the updated script with consideration for the title (it’s still in tags instead of a script):

    add_filter( 'the_seo_framework_after_output', 'my_itemprop_description_init', 11 );
    /**
     * Special filter to keep adding onto The SEO Framework.
     *
     * @param array $functions All the hooked functions.
     * @return array $functions The hooked functions.
     */
    function my_itemprop_description_init( $functions ) {
    
    	$functions[] = array(
    		'callback' => array( 'my_itemprop_description_output' ),
    	);
    	$functions[] = array(
    		'callback' => array( 'my_itemprop_title_output' ),
    	);
    
    	return $functions;
    }
    
    /**
     * Output Google+ Social Description.
     *
     * @return string The Google+ description.
     */
    function my_itemprop_description_output() {
    
    	//* Call the class.
    	$the_seo_framework = the_seo_framework();
    
    	//* Get the social description. Already escaped.
    	$description = $the_seo_framework->description_from_cache( true );
    
    	return '<meta itemprop="description" content="' . $description . '" />' . "\r\n";
    }
    
    /**
     * Output Google+ Social Title.
     *
     * @return string The Google+ title.
     */
    function my_itemprop_title_output() {
    
    	//* Call the class.
    	$the_seo_framework = the_seo_framework();
    
    	//* Get the title from cache. Already escaped.
    	$title = $the_seo_framework->title_from_cache( '', '', '', true );
    
    	return '<meta itemprop="name" content="' . $title . '" />' . "\r\n";
    }

    I hope this works out :)!

    Thread Starter Shaikh Masood Alam

    (@masoodalam51)

    not works

    Plugin Author Sybre Waaijer

    (@cybr)

    Bummer! I’ll go find out what affects Google+ titles and descriptions and will report back once I know more.

    Until then, enjoy the summer! ??

    Thread Starter Shaikh Masood Alam

    (@masoodalam51)

    Problem Solved, Generating a site title for every post is a theme issue and your provided code works fine. Thanks for your help.

    Plugin Author Sybre Waaijer

    (@cybr)

    That’s great to hear Shaikh!

    The provided code will be added in 2.8.0, but then through Schema Articles.
    More on this is found on GitHub.

    Have a wonderful day!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Google Share Title and Description’ is closed to new replies.