snipt

Ctrl+h for KB shortcuts

JavaScript

Add target="_blank" to all external links

$('a').not('[href^="http://dev.madebyvital.com/project/"]').attr('target','_blank');
https://snipt.net/embed/400348f7485063c06f7f700f6d9ada3a/
https://snipt.net/raw/400348f7485063c06f7f700f6d9ada3a/
400348f7485063c06f7f700f6d9ada3a
js
JavaScript
1
2016-09-22T21:20:24
True
False
False
Feb 16, 2016 at 11:59 AM
/api/public/snipt/144262/
add-target_blank-to-all-external-links
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">).</span><span class="nx">not</span><span class="p">(</span><span class="s1">&#39;[href^=&quot;http://dev.madebyvital.com/project/&quot;]&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;target&#39;</span><span class="p">,</span><span class="s1">&#39;_blank&#39;</span><span class="p">);</span> </span></pre></div> </td></tr></table>
links
https://snipt.net/embed/579998a2823b589eef120c8426956fe2/
https://snipt.net/raw/579998a2823b589eef120c8426956fe2/
579998a2823b589eef120c8426956fe2
text
Text only
1
2016-09-22T13:02:47
True
False
False
May 03, 2014 at 06:17 AM
/api/public/snipt/134705/
remove-blue-border-from-links-and-buttons-d6db8d07
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a> </span></pre></div> </td></tr></table>
"blue border", buttons, focus, links

PHP

Imprimir Current Taxonomy sin links

1
2
3
4
<?php
$terms_as_text = get_the_term_list( $post->ID, 'your-custom-taxonomy-name', '', ', ', '' ) ;
echo strip_tags($terms_as_text);
?>
https://snipt.net/embed/13f2c139728a21f8d16018c02f4b6f85/
https://snipt.net/raw/13f2c139728a21f8d16018c02f4b6f85/
13f2c139728a21f8d16018c02f4b6f85
php
PHP
4
2016-09-27T14:55:56
True
False
False
Dec 07, 2012 at 04:00 PM
/api/public/snipt/51428/
imprimir-current-taxonomy-sin-links
<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 id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$terms_as_text</span> <span class="o">=</span> <span class="nx">get_the_term_list</span><span class="p">(</span> <span class="nv">$post</span><span class="o">-&gt;</span><span class="na">ID</span><span class="p">,</span> <span class="s1">&#39;your-custom-taxonomy-name&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;, &#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span> <span class="p">)</span> <span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">echo</span> <span class="nb">strip_tags</span><span class="p">(</span><span class="nv">$terms_as_text</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
links, taxonomy, terms, wordpress

Text only

collection of links

1
2
3
4
5
6
not exactly a snipt, but a collection of useful sites :)

http://stdcxx.apache.org/doc/stdlibref/index.html
http://stdcxx.apache.org/doc/stdlibug/index.html
http://en.cppreference.com/w/cpp
boost and stuff
https://snipt.net/embed/9cdddc8ff47bf6e0ee0026655c000ae0/
https://snipt.net/raw/9cdddc8ff47bf6e0ee0026655c000ae0/
9cdddc8ff47bf6e0ee0026655c000ae0
text
Text only
6
2016-09-24T02:41:35
True
False
False
/api/public/snipt/34241/
collection-of-links
<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></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>not exactly a snipt, but a collection of useful sites :) </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>http://stdcxx.apache.org/doc/stdlibref/index.html </span><span id="L-4"><a name="L-4"></a>http://stdcxx.apache.org/doc/stdlibug/index.html </span><span id="L-5"><a name="L-5"></a>http://en.cppreference.com/w/cpp </span><span id="L-6"><a name="L-6"></a>boost and stuff </span></pre></div> </td></tr></table>
links

JavaScript

external links new window

1
2
3
4
// external links new window
$(document).ready(function(){
 $("a[@href^='http']").attr('target','_blank');
});
https://snipt.net/embed/578b67fbb5fa70ee0f7da882d8259137/
https://snipt.net/raw/578b67fbb5fa70ee0f7da882d8259137/
578b67fbb5fa70ee0f7da882d8259137
js
JavaScript
4
2016-09-29T00:38:03
True
False
False
/api/public/snipt/33583/
external-links-new-window
<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 id="L-1"><a name="L-1"></a><span class="c1">// external links new window</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nx">ready</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">$</span><span class="p">(</span><span class="s2">&quot;a[@href^=&#39;http&#39;]&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;target&#39;</span><span class="p">,</span><span class="s1">&#39;_blank&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="p">});</span> </span></pre></div> </td></tr></table>
"new window", external, jquery, links
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.