snipt

Ctrl+h for KB shortcuts

JavaScript

Official Facebook Share button in Wordpress

1
2
3
4
<a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

/*compact version*/
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
https://snipt.net/embed/a8df990f7464faf49b7d75bc6f309e90/
/raw/a8df990f7464faf49b7d75bc6f309e90/
a8df990f7464faf49b7d75bc6f309e90
js
JavaScript
4
2019-06-21T04:02:23
True
False
False
/api/public/snipt/26752/
official-facebook-share-button-in-wordpress
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="o">&lt;</span><span class="nx">a</span> <span class="nx">name</span><span class="o">=</span><span class="s2">&quot;fb_share&quot;</span> <span class="nx">type</span><span class="o">=</span><span class="s2">&quot;box_count&quot;</span> <span class="nx">href</span><span class="o">=</span><span class="s2">&quot;http://www.facebook.com/sharer.php&quot;</span><span class="o">&gt;</span><span class="nx">Share</span><span class="o">&lt;</span><span class="sr">/a&gt;&lt;script src=&quot;http:/</span><span class="o">/</span><span class="kr">static</span><span class="p">.</span><span class="nx">ak</span><span class="p">.</span><span class="nx">fbcdn</span><span class="p">.</span><span class="nx">net</span><span class="o">/</span><span class="nx">connect</span><span class="p">.</span><span class="nx">php</span><span class="o">/</span><span class="nx">js</span><span class="o">/</span><span class="nx">FB</span><span class="p">.</span><span class="nx">Share</span><span class="s2">&quot; type=&quot;</span><span class="nx">text</span><span class="o">/</span><span class="nx">javascript</span><span class="s2">&quot;&gt;&lt;/script&gt;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="s2">/*compact version*/</span> </span><span id="L-4"><a name="L-4"></a><span class="s2">&lt;a name=&quot;</span><span class="nx">fb_share</span><span class="s2">&quot; type=&quot;</span><span class="nx">button_count</span><span class="s2">&quot; href=&quot;</span><span class="nx">http</span><span class="o">:</span><span class="c1">//www.facebook.com/sharer.php&quot;&gt;Share&lt;/a&gt;&lt;script src=&quot;http://static.ak.fbcdn.net/connect.php/js/FB.Share&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</span> </span></pre></div> </td></tr></table>
share, social, wordpress

PHP

Legacy Facebook share button (with some PHP)

1
2
3
<!-- Legacy Facebook share button (with some PHP) -->
<a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php?u=<?php echo urlencode('http://someurl.com/with/options'); ?>&amp;t=<?php echo urlencode('The title of the page'); ?>">Share</a>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"></script>
https://snipt.net/embed/5a2d948c46b9e83e6c0345fadd998a70/
/raw/5a2d948c46b9e83e6c0345fadd998a70/
5a2d948c46b9e83e6c0345fadd998a70
php
PHP
3
2019-07-07T16:52:54
True
False
False
/api/public/snipt/23515/
legacy-facebook-share-button
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">&lt;!-- Legacy Facebook share button (with some PHP) --&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="x">&lt;a name=&quot;fb_share&quot; type=&quot;button_count&quot; href=&quot;http://www.facebook.com/sharer.php?u=</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nb">urlencode</span><span class="p">(</span><span class="s1">&#39;http://someurl.com/with/options&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">&amp;amp;t=</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nb">urlencode</span><span class="p">(</span><span class="s1">&#39;The title of the page&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x">&quot;&gt;Share&lt;/a&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="x">&lt;script type=&quot;text/javascript&quot; src=&quot;http://static.ak.fbcdn.net/connect.php/js/FB.Share&quot;&gt;&lt;/script&gt;</span> </span></pre></div> </td></tr></table>
facebook, service, share