snipt

Ctrl+h for KB shortcuts

Text only

piece of code

apex stuff
https://snipt.net/embed/763e1221e27c4aa73f2d4af83ab5b2e0/
https://snipt.net/raw/763e1221e27c4aa73f2d4af83ab5b2e0/
763e1221e27c4aa73f2d4af83ab5b2e0
text
Text only
1
2016-09-26T17:58:22
True
False
False
Apr 20, 2016 at 08:32 AM
/api/public/snipt/145525/
piece-of-code
<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>apex stuff </span></pre></div> </td></tr></table>
1, apex, tag

PHP

WordPress: PHP 'template tag' code to display shortcode inside a page template

<?php echo do_shortcode("[shortcode]"); ?>
https://snipt.net/embed/84539a0eede12f247b52e6b1fb2f23b1/
https://snipt.net/raw/84539a0eede12f247b52e6b1fb2f23b1/
84539a0eede12f247b52e6b1fb2f23b1
php
PHP
1
2016-10-01T09:33:46
True
False
False
Dec 17, 2015 at 08:20 PM
/api/public/snipt/143152/
wordpress-php-template-tag-code-to-display-shortcode-inside-a-page-template
<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="cp">&lt;?php</span> <span class="k">echo</span> <span class="nx">do_shortcode</span><span class="p">(</span><span class="s2">&quot;[shortcode]&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
shortcode, tag, template, wordpress

HTML+PHP

Remove REL="" Atribute category tag wordpress

1
2
3
4
5
6
<?php
add_filter( 'the_category', 'add_nofollow_cat' ); 
function add_nofollow_cat( $text ) { 
$text = str_replace('rel="category tag"', "", $text); return $text; 
}
?>
https://snipt.net/embed/66c4a1ed9af38492de43c901e1bbdadb/
https://snipt.net/raw/66c4a1ed9af38492de43c901e1bbdadb/
66c4a1ed9af38492de43c901e1bbdadb
html+php
HTML+PHP
6
2016-10-01T08:00:48
True
False
False
/api/public/snipt/48390/
remove-rel-atribute-category-tag-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> <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><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">add_filter</span><span class="p">(</span> <span class="s1">&#39;the_category&#39;</span><span class="p">,</span> <span class="s1">&#39;add_nofollow_cat&#39;</span> <span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="k">function</span> <span class="nf">add_nofollow_cat</span><span class="p">(</span> <span class="nv">$text</span> <span class="p">)</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a><span class="nv">$text</span> <span class="o">=</span> <span class="nb">str_replace</span><span class="p">(</span><span class="s1">&#39;rel=&quot;category tag&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="nv">$text</span><span class="p">);</span> <span class="k">return</span> <span class="nv">$text</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span><span id="L-6"><a name="L-6"></a><span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
"remove rel", W3C, category, rel, tag, wordpress

PHP

Create hyperlinks within text

1
2
3
4
function create_hyperlinks_within_text( $text )
{
    return preg_replace('@(http)?(s)?(://)?(([-\w]+\.)+([^\s]+)+[^,.\s])@', '<a href="http$2://$4">$1$2$3$4</a>', $text );
}
https://snipt.net/embed/fb1ba49b2d5b01df81043606cf52617a/
https://snipt.net/raw/fb1ba49b2d5b01df81043606cf52617a/
fb1ba49b2d5b01df81043606cf52617a
php
PHP
4
2016-09-29T18:11:23
True
False
False
/api/public/snipt/39935/
create-hyperlinks-within-text
<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="x">function create_hyperlinks_within_text( $text )</span> </span><span id="L-2"><a name="L-2"></a><span class="x">{</span> </span><span id="L-3"><a name="L-3"></a><span class="x"> return preg_replace(&#39;@(http)?(s)?(://)?(([-\w]+\.)+([^\s]+)+[^,.\s])@&#39;, &#39;&lt;a href=&quot;http$2://$4&quot;&gt;$1$2$3$4&lt;/a&gt;&#39;, $text );</span> </span><span id="L-4"><a name="L-4"></a><span class="x">}</span> </span></pre></div> </td></tr></table>
anchor, regexp, tag, text
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.