Facebook and Twitter Sharing - include name of website

jasondgray May 23, 2012 11:04PM EDT

Newbie questions, apologies in advance.

I have a site that has several embedded articles to share. The articles are pulled from RSS feeds from other sites. If someone shares/tweets on my site, I would like the name of my webpage to appear somewhere in the share/tweet. I can't figure out the right code to the add to the addthis code that was included in my wordpress theme. Code is as follows. I have no idea whether this will be helpful to my question. Thanks in advance for any responses.

$icon_social_icons_html = '
<div class="addthis_toolbox addthis_default_style' . $photoclass . '">
<a class="addthis_button_facebook" addthis:url="' . $permalink . '"></a>
<a class="addthis_button_twitter" addthis:url="' . $permalink . '" addthis:title="' . esc_attr($title) . $twittername . '"></a>
<a class="addthis_button_email" addthis:url="' . $permalink . '" addthis:title="' . esc_attr($title) . '"></a>
<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact" addthis:url="' . $permalink . '" addthis:title="' . esc_attr($title) . '"></a>
</div>';
$working_item = str_replace('{ITEM_SOCIAL_ICONS}', $icon_social_icons_html, $working_item);
}
else {
$working_item = str_replace('{ITEM_SOCIAL_ICONS}', '', $working_item);
}

Up 0 Rated Down
Paul (AddThis Happiness Specialist) May 24, 2012 12:11PM EDT
The addthis:url and addthis:title parameters work in the toolbox div, not the individual buttons. So here's how I'd do it:

<div class="addthis_toolbox addthis_default_style' . $photoclass . '" addthis:url="' . $permalink . '" addthis:title="' . esc_attr($title) . '">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact"></a>
</div>

This question is closed to new answers.

Still need help?


General Topics

 

Developers