WordPress.org

Ready to get started?Download WordPress

Forums

Sociable
Facebook button points to wrong post (conflict with YARPP & similar plugins) (6 posts)

  1. vertigoart
    Member
    Posted 3 years ago #

    Not sure where to report a problem with the plugin, so I'll just post here...

    I encountered an error when using GetSocial plugin with other plugins that call get_the_excerpt() functions. Specifically, some of the buttons (like Facebook Share) will point to the last post the get_the_excerpt() was called on, and not the post being processed.

    Specifically, in my case I have YARPP plugin generate 5 related posts and display their excerpts at the end of each single post (e.g. http://www.typical-human.com/oddity-1936). The Facebook Share button will then 'point' to the last post the YARPP generated.

    The reason for it is the following.

    Sociable hooks into the 'the_content' to cache permalink to the post as a global variable, and builds the share buttons using this variable when the footer is processed.

    Unfortunately, WordPress applies 'the_content' filters inside get_the_excerpt() (see formatting.php line 1870), causing the Sociable to re-cache the permalink for the wrong post ID.

    I am not sure how to fix it 'elegantly' yet, but one thing is clear - global variables are evil :)

    If anyone has suggestions on a good fix, please let me know.

    http://wordpress.org/extend/plugins/GetSocial/

  2. bengalak
    Member
    Posted 3 years ago #

    Get Social floating bar not showing in Chrome... Javascript is in the page html... see http://matei.org/ ... any page

  3. daniel_henrique
    Member
    Posted 2 years ago #

    Hi vertigoart.

    I think I'm facing the same issue (http://inconvencional.com.br/). Have you find a workaround?

    Thanks in advance.

    Best regards,

    Daniel.

  4. daniel_henrique
    Member
    Posted 2 years ago #

    Hi

    I apologize for my mistake. GetSocial plugin was installed, but it was disabled. Another social plugin was causing the problem.

    Thanks.

    Best regards,

    Daniel.

  5. brent3721
    Member
    Posted 2 years ago #

    same problem here anyone figure out how to fix it?

  6. brent3721
    Member
    Posted 2 years ago #

    The awesome people at blogplay helped me out fixing this issue, here's what it was for me, my original code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    -------------------------------and the fixed code is below----------------

    [Code moderated as per the Forum Rules. Please use the pastebin]

    the two changed areas have sociable comments around them, hopefully this helps someone else out!

    brent
    [sig moderated as per the Forum Rules]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags