WordPress.org

Support

Support » Plugins and Hacks » [Resolved] FB sharing description issues

[Resolved] FB sharing description issues

  • gallinula
    Member

    @gallinula

    Hey,
    first of all thank you for a great plugin, it really lowers the bounce rate on my website.

    Since I installed and configured your plugin I have a problem with sharing my posts on Facebook.
    The description of post is not the excerpt (usually first lines from post) but part of your plugin, like “See related posts: Article one title Article two title”.

    I’m using Open Graph. My header includes:
    <meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />
    or
    <meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />

    Either of above does not work properly. When I use Facebook Debugger it shows that og:description takes not the posts but the part of WordPress Related Posts plugin.

    Any idea how I should proceed to get proper descriptions?
    Thanks in advance

    http://wordpress.org/plugins/wordpress-23-related-posts-plugin/

Viewing 9 replies - 1 through 9 (of 9 total)
  • conservativeread
    Member

    @conservativeread

    same problem here wp_wp_rp_tags

    Mateja
    Member

    @sparkica

    Hey,

    our big apologies for the delay in our response, all the work during holidays and the changes we were about to set with the new years got us a bit stranded with support. We’ll look into this asap.

    Can you please tell me which version of WordPress and the plugin you’re using?

    conservativeread
    Member

    @conservativeread

    wordpress 3.8 plgin v 3.3 wp_wp_rp_tags creates a database entry and interferes with og tags.

    Mateja
    Member

    @sparkica

    Thanks for the details.

    Mateja
    Member

    @sparkica

    Hey,

    @gallinula
    according to the Function Reference for get_the_excerpt this tag must be used within The Loop. I’m guessing using it outside The Loop was causing the problems. I think I found a solution – it works on our test blog.

    I suggest you replace the line you were using in header
    <meta property="og:description" content="<?php echo get_the_excerpt(); ?>" />
    with these lines:

    <?php if ( (is_page()) || (is_single()) ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <meta name="og:description" content="<?php echo get_the_excerpt(); ?>" />
    <?php endwhile; endif; elseif(is_home()) : ?>

    Please let me know if this works for you.

    @conservativeread
    Do you have any special OG-related plugin installed? If not, can you please post a snippet of code where you generate og tags? This would help me understand how could wp_wp_rp_tags interfere with og tags.

    conservativeread
    Member

    @conservativeread

    og plugin http://wordpress.org/plugins/open-graph-protocol-framework/

    however happens on twittercards only see example tweet:

    I have since removed the plugin and have no problem but also no related posts either please reply thank you

    Mateja
    Member

    @sparkica

    @conservativeread
    I’ve tested this OG plugin with our plugin and I figured out they that the content from our plugin is ready before the post content is available and hence OG plugin generates description from “Related posts” and two related post titles.

    We’ll add a fix for this in our next release.

    Thanks for your patience,
    Mateja

    conservativeread
    Member

    @conservativeread

    thank you very much

    Mateja
    Member

    @sparkica

    Hey,

    we released updated version of the plugin. We included a bugfix for the issue with OG plugins.
    Can you please update our plugin and check if everything works as expected so I can close the topic?

    Thanks.

    Best,
    Mateja

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] FB sharing description issues’ is closed to new replies.