WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[resolved] [Plugin: AddThis] Tip: Controlling position in a template (14 posts)

  1. Workshopshed
    Member
    Posted 2 years ago #

    I could not work out how to have both a custom position for the toolbar and to get the share button with the counter on it using the custom styles as mentioned in the add this blog on the "template tag"

    However I found a much simpler way.

    1) Select the desired style to display below the post
    2) In the advanced tab, turn off all of the show options
    3) Add the following to your template where you want the item to display

    <?php do_action('addthis_widget',get_permalink($post->ID), get_the_title($post->ID), 'below'); ?>

    If you want to customise your buttons later, you can do that without needing change any code.

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

  2. Workshopshed
    Member
    Posted 2 years ago #

    Scrap that idea, it does not work, I've ended up with duplicate.

  3. Workshopshed
    Member
    Posted 2 years ago #

    The solution was as follows:

    1) Set the display before and display after to none
    2) In the advanced tab, turn off all of the show options
    3) Add the following to your template where you want the item to display

    do_action('addthis_widget',get_permalink($post->ID), get_the_title($post->ID), 'fb_tw_p1_sc');

    The string 'fb_tw_p1_sc' is one of the "new styles" which you can select in the options but not if you use the custom styles. The complete list of valid values in Version 2.3.2 are:

    'small_toolbox'
    'plus_one_share_counter'
    'small_toolbox_with_share'
    'large_toolbox'
    'fb_tw_sc'
    'fb_tw_p1_sc'
    'simple_button'
    'button'
    'share_counter'

  4. Agnes
    Member
    Posted 1 year ago #

    I found a way to insert a custom style in my template, according to this page:
    http://www.addthis.com/blog/2011/03/03/addthis-for-wordpress-plugin-version-2-0-2/#.T6Op0Os5Ld4

    I added my style as an array in the plugin file (addthis_social_widget.php)

    $addthis_new_styles = array(
    
        'my_style' => array( 'src' =>  '<div class="addthis_toolbox addthis_default_style addthis_" %s ><a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a><a class="addthis_button_google_plusone_share"></a><a href="http://www.addthis.com/bookmark.php?v=250&pubid=ra-4fa382503d81907c" class="addthis_button_compact">
    <a class="addthis_button_email"></a><a class="addthis_button_print"></a><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a></div>', 'img' => 'toolbox-small.png', 'name' => 'My Style', 'above' => 'hidden ', 'below' => ''
        ), // My Style

    And then added the code manually in the template with my style

    <?php do_action('addthis_widget',get_permalink($post->ID), get_the_title($post->ID), 'my_style'); ?>

  5. trumanews
    Member
    Posted 1 year ago #

    I'm sorry, but it's not clear how to avoid duplication...

  6. Workshopshed
    Member
    Posted 1 year ago #

    Because you are explicitly calling the "do_action" you need to turn off all of the settings in the plugin options.

    1) Set the display before and display after to none
    2) In the advanced tab, turn off all of the show options

  7. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Good job @Workshopshed! You explained it well and neat!

  8. trumanews
    Member
    Posted 1 year ago #

    That's what I did. But it doesn't work...

  9. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @trumanews: Can you provide me a link to your site? I will have a look. Or you can mail me to srijith[AT]addthis.com

  10. trumanews
    Member
    Posted 1 year ago #

    @srijith.v e-mail sent. did you get it?

  11. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    @trumanews: Yes, I got the link. I cannot find any duplication there. Can you brief the steps you did to place addthis share buttons on the site?

  12. trumanews
    Member
    Posted 1 year ago #

    @srijith.v: I follwed Workshopshed's steps listed above:

    1) Set the display before and display after to none
    2) In the advanced tab, turn off all of the show options
    3) Add the following to your template where you want the item to display

    do_action('addthis_widget',get_permalink($post->ID), get_the_title($post->ID), 'fb_tw_p1_sc');

    What I get is here: http://imageshack.us/photo/my-images/542/vraddthis.png/

  13. trumanews
    Member
    Posted 1 year ago #

    @srijith.v: that'all right. now seems to work, i don't konw why...

    thanks for your patience!!

  14. srijith.v
    AddThis Samurai
    Plugin Author

    Posted 1 year ago #

    Glad to know that!

    Cheers,
    Srijith

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic