• Resolved deodat

    (@deodat)


    Hello,

    I’m trying very hard to add Sharing Buttons in my templates for a Custom Post Type and in my Sidebar (sidebar.php). I’ve read a lot of threads, tutoriales and comments, but no matter what, it doesn’t work. I’ve tried the do_action(‘addthis_widget’…) stuff with type custom, etc. … didn’t work even if my get_permalink() and get_the_title() were perfectly good.

    Am I missing something ? where can I find a step by step article ?

    Thanks a lot in advance for helping me ??

    D

    https://www.ads-software.com/plugins/addthis/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter deodat

    (@deodat)

    Maybe something : there is no “Show AddThis Sharing buttons” in my custom post type’s page (not even in the screen options)

    Plugin Author addthis_matt

    (@addthis_matt)

    Hi there,

    I replied to a message you left within another thread. We’re working on adding support for custom post types and supporting do_action() for the next 4.x version of our plugin. For now, I’d recommend using our older version, 3.5.10 which will support do_action().
    https://support.addthis.com/customer/portal/articles/1914248-wordpress-plugin-repository

    Thread Starter deodat

    (@deodat)

    Hi Matt,

    The link to 3.5.xx doesn’t work :
    https://addthis.desk.com/admin/content-management/attachments/50495/original.zip?1426276630

    Can you paste me the direct link here ?

    Thanks,

    Regards,

    D

    Thread Starter deodat

    (@deodat)

    Thread Starter deodat

    (@deodat)

    Sorry to come back with this story but… I’m thinking : is it really impossible to add “AddThis” in a custom post type with the last version or in a sidebar template ?

    Best,

    D

    Plugin Author addthis_matt

    (@addthis_matt)

    Hi Deodat,

    You wouldn’t be able to use do_action() within the template, but you could insert our inline <div> into the sidebar template, or anywhere else. Depending on which buttons you want to add, the class name for the <div> would be different.

    Could you send me your AddThis profile ID so that I can see which buttons you have activated, or send me the URL of your website?

    Thread Starter deodat

    (@deodat)

    Hi Matt,

    This could be great.
    I’d like to insert the Sharing Buttons.

    This is my ID : ra-5194d4ba10c9f2ae

    My website is in local, sorry (working for an agency not directly).

    Best,

    D

    Plugin Author addthis_matt

    (@addthis_matt)

    I’ve setup your profile so that it’s able to use this inline code for the Sharing Buttons:

    <div class=”addthis_sharing_toolbox”>

    If you’d like to override the URL or title that’s shared, rather than using the current page URL, you can do so like this:

    <div class=”addthis_sharing_toolbox” data-url=”<?php the_permalink(); ?>” data-title=”<?php the_title_attribute(); ?>”></div>

    Let me know if you have any questions.

    Thanks,
    Matt

    Thread Starter deodat

    (@deodat)

    Thanks a lot Matt ! this works great (is it documented somewhere ?)

    Best,

    Deodat

    Thread Starter deodat

    (@deodat)

    Mmmmmm…. it doesn’t work anymore and I didn’t change anything ??

    Deodat

    Thread Starter deodat

    (@deodat)

    And it appears now somewhere I don’t need.

    Thread Starter deodat

    (@deodat)

    Is it because I use it locally and in staging ?

    Plugin Author addthis_matt

    (@addthis_matt)

    Hi Deodat,

    The setup I created for you is a bit custom, as it requires us to make a change on our backend. Therefore, it’s not publicly documented.

    The buttons should still work locally, as long as you’re opening the page with https:// rather than file://.

    Thread Starter deodat

    (@deodat)

    Hi Matt,

    Unfortunately, the buttons didn’t work with :

    <div class="addthis_sharing_toolbox" data-url="<?php the_permalink(); ?>" data-title="<?php the_title_attribute(); ?>"></div>

    and I couldn’t understand why, so I rolled back to the older 3.5.10 version with this code :

    <?php do_action( 'addthis_widget', get_permalink(), get_the_title(), array(
                        'type' => 'custom',
                        'size' => '32', // size of the icons.  Either 16 or 32
                        'services' => 'facebook,twitter,pinterest_share,google_plusone_share', // the services you want to always appear
                        'preferred' => '0', // the number of auto personalized services
                        'more' => true, // if you want to have a more button at the end
                        'counter' => false
                    ));
                ?>

    Hope this will be easier to integrate in a future version.

    Best,

    Deodat

    Plugin Author addthis_matt

    (@addthis_matt)

    Hi Deodat,

    It looks like you have the Sharing Buttons disabled in your account settings:
    https://www.addthis.com/dashboard#gallery

    The Original Sharing Buttons are enabled instead. Would you prefer to show these buttons instead? I can make the custom change as I did for the Sharing Buttons, if you’d prefer to use the newer plugin.

    However, since it looks like you’re just using sharing buttons and no other dashboard features, it might be best to just stick with 3.5.10, since this version would offer all of the features you need. The advantage of the 4.x version would be to use the other tools in the dashboard, such as the content recommendation widgets or marketing tools.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Sharing Buttons in a Custom Post Type and in Sidebar (via templates)’ is closed to new replies.