snipt

Ctrl+h for KB shortcuts
Notice: Snipt is moving away from free accounts on May 1st, 2014. Read more about the transition here.
#48795

PHP

AddThis with custom buttons including Google+

1
2
3
4
5
6
7
8
<div class="addthis_toolbox">
<a class="addthis_button_facebook"><img src="<?php bloginfo('template_url'); ?>/images/icon-facebook.png" /></a>
<a class="addthis_button_twitter"><img src="<?php bloginfo('template_url'); ?>/images/icon-twitter.png" /></a>
<a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="popUp=window.open('https://plus.google.com/share?url=<?php the_permalink(); ?>', 'popupwindow', 'scrollbars=yes,width=800,height=400');popUp.focus();return false">
<img src="<?php bloginfo('template_url'); ?>/images/icon-gplus.png" alt="Google+" title="Google+"/>
</a>
<a class="addthis_button_email"><img src="<?php bloginfo('template_url'); ?>/images/icon-mail.png" /></a>
</div>
https://snipt.net/embed/f951c0ba61950ca717b145c250b545c0/
https://snipt.net/raw/f951c0ba61950ca717b145c250b545c0/
f951c0ba61950ca717b145c250b545c0
php
PHP
8
2014-04-23T17:52:20
True
False
/api/public/snipt/48795/
addthis-with-custom-buttons-including-google
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="x">&lt;div class=&quot;addthis_toolbox&quot;&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="x">&lt;a class=&quot;addthis_button_facebook&quot;&gt;&lt;img src=&quot;</span><span class="cp">&lt;?php</span> <span class="nx">bloginfo</span><span class="p">(</span><span class="s1">&#39;template_url&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">/images/icon-facebook.png&quot; /&gt;&lt;/a&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="x">&lt;a class=&quot;addthis_button_twitter&quot;&gt;&lt;img src=&quot;</span><span class="cp">&lt;?php</span> <span class="nx">bloginfo</span><span class="p">(</span><span class="s1">&#39;template_url&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">/images/icon-twitter.png&quot; /&gt;&lt;/a&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="x">&lt;a href=&quot;https://plus.google.com/share?url=</span><span class="cp">&lt;?php</span> <span class="nx">the_permalink</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x">&quot; onclick=&quot;popUp=window.open(&#39;https://plus.google.com/share?url=</span><span class="cp">&lt;?php</span> <span class="nx">the_permalink</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x">&#39;, &#39;popupwindow&#39;, &#39;scrollbars=yes,width=800,height=400&#39;);popUp.focus();return false&quot;&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="x">&lt;img src=&quot;</span><span class="cp">&lt;?php</span> <span class="nx">bloginfo</span><span class="p">(</span><span class="s1">&#39;template_url&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">/images/icon-gplus.png&quot; alt=&quot;Google+&quot; title=&quot;Google+&quot;/&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="x">&lt;/a&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="x">&lt;a class=&quot;addthis_button_email&quot;&gt;&lt;img src=&quot;</span><span class="cp">&lt;?php</span> <span class="nx">bloginfo</span><span class="p">(</span><span class="s1">&#39;template_url&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">/images/icon-mail.png&quot; /&gt;&lt;/a&gt;</span> </span><span id="L-8"><a name="L-8"></a><span class="x">&lt;/div&gt;</span> </span></pre></div> </td></tr></table>
addthis
#37609

PHP

Add this config options

1
2
3
4
5
6
7
8
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
	<script type="text/javascript">
		var addthis_config =
		{
		   ui_language: "hr"
		
		}
	</script>
https://snipt.net/embed/3509ec56d1e7b76a40dfac1e4ee410c2/
https://snipt.net/raw/3509ec56d1e7b76a40dfac1e4ee410c2/
3509ec56d1e7b76a40dfac1e4ee410c2
php
PHP
8
2014-04-09T08:40:53
True
False
/api/public/snipt/37609/
add-this-config-options
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="x">&lt;script type=&quot;text/javascript&quot; src=&quot;http://s7.addthis.com/js/250/addthis_widget.js&quot;&gt;&lt;/script&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="x"> &lt;script type=&quot;text/javascript&quot;&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="x"> var addthis_config =</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> {</span> </span><span id="L-5"><a name="L-5"></a><span class="x"> ui_language: &quot;hr&quot;</span> </span><span id="L-6"><a name="L-6"></a><span class="x"> </span> </span><span id="L-7"><a name="L-7"></a><span class="x"> }</span> </span><span id="L-8"><a name="L-8"></a><span class="x"> &lt;/script&gt;</span> </span></pre></div> </td></tr></table>
addthis
#37244

CSS

AddThis float fix

1
2
3
4
5
/* 
 * fix for addthis when used in a float
 * addthis plugin is wrapped in a div with clear:both, this can interfere with floating
*/
div.atclear { display:none !important; }
https://snipt.net/embed/3f4bc148d8f1dae790e1a62ff8292a65/
https://snipt.net/raw/3f4bc148d8f1dae790e1a62ff8292a65/
3f4bc148d8f1dae790e1a62ff8292a65
css
CSS
5
2014-04-24T02:35:40
True
False
/api/public/snipt/37244/
addthis-float-fix
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">/* </span> </span><span id="L-2"><a name="L-2"></a><span class="c"> * fix for addthis when used in a float</span> </span><span id="L-3"><a name="L-3"></a><span class="c"> * addthis plugin is wrapped in a div with clear:both, this can interfere with floating</span> </span><span id="L-4"><a name="L-4"></a><span class="c">*/</span> </span><span id="L-5"><a name="L-5"></a><span class="nt">div</span><span class="nc">.atclear</span> <span class="p">{</span> <span class="k">display</span><span class="o">:</span><span class="k">none</span> <span class="cp">!important</span><span class="p">;</span> <span class="p">}</span> </span></pre></div> </td></tr></table>
"float fix", addthis, css