WordPress.org

Ready to get started?Download WordPress

Forums

Share Buttons by AddThis
[Plugin: AddThis] How can I place this manually in my template and have it link correctly. (9 posts)

  1. Tosh
    Member
    Posted 4 years ago #

    I put the <?php do_action( 'addthis_widget' ); ?> where I wanted it to be, but if for example I try to tweet the post I'm on while on the home page. It just tweets the home page instead of the post url???

    How can I fix this?

  2. jumust
    Member
    Posted 3 years ago #

    I have the same issue, I inserted it in the home page inside the Post tag:

    <div class="entry"><?php do_action( 'addthis_widget' ); ?>
                   		<?php the_excerpt(); ?>
                   	</div>

    but it share the whole website, not only the single post.

    But if I use it on Full Post page It works correctly.

  3. Tosh
    Member
    Posted 3 years ago #

    I ended up just having the plugin place it for me. I gave up on placing it manually.

  4. jumust
    Member
    Posted 3 years ago #

    where is it placed automatically? because for me it shows under the post title but still share the whole page

  5. Tosh
    Member
    Posted 3 years ago #

    See here - http://www.ps3blog.net/ It's at the bottom of each post.

  6. _mjk_
    AddThis Samurai
    Plugin Author

    Posted 3 years ago #

    The template tag supports custom URLs and titles:
    <?php do_action( 'addthis_widget', $url, $title); ?>

    Does that solve your problem?

    Best,
    Matt

  7. s0fa
    Member
    Posted 3 years ago #

    for me it works on individual posts (although in the code looks like the Brand title gets called instead of the post title and the url is missing entirely), but not on categories/archives. It'll grab the title of the category rather than of the post. I even went in an added the addthis:url="$url" addthis:title="$title", same issue.

    solution: add it automatically :\

  8. jocken
    Member
    Posted 3 years ago #

    I solved it!

    This is just the single button which says share.

    <?php $url = get_permalink(); $title = the_title('','', false); ?><a class="addthis_counter addthis_pill_style" addthis:url="<?php echo $url; ?>" addthis:title="<?php echo $title; ?>"></a>

    However, it does not catch the post image because it still checks the page and not the post, will see if I can fix that to.

    Updated:

    It works with some images

  9. anotherandrew
    Member
    Posted 3 years ago #

    Not working!

    I want to display the button like on the example page above at http://www.ps3blog.net/

    So that it is under every excerpt

    AND I want to use custom images.

    Does anyone have some advice?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags