Return to Snippet

Revision: 43958
at April 4, 2011 07:20 by alexeihidalgo


Initial Code
function share_please($content){
    if(!is_feed() && !is_home()) {
        $content .= '<div class="share-this">
                    <a href="<a href="http://twitter.com/share&quot" rel="nofollow">http://twitter.com/share&quot</a>;
class="twitter-share-button"
data-count="horizontal">Tweet</a>
                    <script type="text/javascript"
src="<a href="http://platform.twitter.com/widgets.js%22%3E%3C/script&gt" rel="nofollow">http://platform.twitter.com/widgets.js"></script&gt</a>;
                    <div class="facebook-share-button">
                        <iframe
src="<a href="http://www.facebook.com/" rel="nofollow">http://www.facebook.com/</a><a title="plugins" href="http://wptricks.net/category/plugins/">plugins</a>/like.php?href='.
urlencode(get_permalink($post->ID))
.'&amp;layout=button_count&amp;show_faces=false&amp;width=200&amp;action=like&amp;colorscheme=light&amp;height=21"
scrolling="no" frameborder="0" style="border:none;
overflow:hidden; width:200px; height:21px;"
allowTransparency="true"></iframe>
                    </div>
                </div>';
    }
    return $content;
}
add_action('the_content', 'share_please');

Initial URL

                                

Initial Description

                                

Initial Title
Home / Tricks / How To Automatically add Twitter and Facebook buttons to your posts How To Automatically add Twitter and Faceboo

Initial Tags

                                

Initial Language
PHP