WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
AddThis truncates URL (8 posts)

  1. Cathryn999
    Member
    Posted 1 year ago #

    I'm using the addthis wordpress plugin on a custom-built wordpress theme that is highly customised.

    Addthis installs the share buttons fine above the content, but doesn't grab the full URL to share. The full URL is dynamically generated ie

    http://mywebsite.com/property?pid=4966

    Addthis truncates the url at /property, ie the url it shares doesn't have the php paramaters necessary for the link to display correctly. This is the url it shares:

    http://myebsite.com/property <== "?pid=nnnn" is missing

    Is there some way around this?

    Thanks :-)

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

  2. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    That's weird! Can I have a link to the site? You can send it to srijith[at]addthis.com or share it here.

  3. Cathryn999
    Member
    Posted 1 year ago #

    Hey there. I've had to remove it from the production site but you can see it on the dev site here:
    darwinholidayapartments.biz/dhadev/accommodation/property?pid=5764

    - I've just installed the standard plug-in, obviously need to muck around with location and so on but before I do that I need to know it will pass the full URL first. Thanks, let me know how you go.
    Cathryn.

  4. Cathryn999
    Member
    Posted 1 year ago #

    oh - ignore the social share icons at the top of the page - they're going! - it's the addthis icons just above the property name that I'm wanting to get working. cheers.

  5. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Cathryn: Spotted it! Thanks for reporting it. Let me check whether it's an issue with our plugin or conflict with some other plugins/themes installed.

  6. Cathryn999
    Member
    Posted 1 year ago #

    Yay! Keep me posted. Can give you login to dev site if you want to check other plugins.

  7. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Of course Cathryn! Would be helpful if you can send the dev site details to srijith[AT]addthis.com.

  8. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Hey Cathryn!

    Finally got the issue reason. The parameter pid is a custom added one by the template you are using. AddThis uses get_permalink() function of wordpress to get the url to be shared and get_permalink() misses the user added parameters. The quick fix is to change the code a bit to stick your added parameters to the get_permalink() output. I can provide the steps here.

    In function (File: addthis_social_widget.php, in wp-content/plugins/addthis)

    function addthis_display_social_widget($content, $filtered = true, $below_excerpt = false)

    on line# 1327,

    Current
    =================================================

    $url = get_permalink();

    =================================================

    Change to
    =================================================

    $query_string_list = $_GET;
    if (array_key_exists('attest', $query_string_list)) {
        unset($query_string_list['attest']);
    }
    $url = add_query_arg( $query_string_list, get_permalink());

    =================================================

    Try it and let me know if it worked.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.