WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Related Posts
[resolved] FB sharing description issues (10 posts)

  1. gallinula
    Member
    Posted 9 months ago #

    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/

  2. conservativeread
    Member
    Posted 8 months ago #

    same problem here wp_wp_rp_tags

  3. Mateja
    Member
    Plugin Author

    Posted 8 months ago #

    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?

  4. conservativeread
    Member
    Posted 8 months ago #

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

  5. Mateja
    Member
    Plugin Author

    Posted 8 months ago #

    Thanks for the details.

  6. Mateja
    Member
    Plugin Author

    Posted 8 months ago #

    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.

  7. conservativeread
    Member
    Posted 8 months ago #

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

    however happens on twittercards only see example tweet:

    https://twitter.com/keichri/statuses/418838701657972736

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

  8. Mateja
    Member
    Plugin Author

    Posted 8 months ago #

    @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

  9. conservativeread
    Member
    Posted 8 months ago #

    thank you very much

  10. Mateja
    Member
    Plugin Author

    Posted 7 months ago #

    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

Reply

You must log in to post.

About this Plugin

About this Topic