snipt

Ctrl+h for KB shortcuts

Text only

Format a link based on it linking to a pdf

1
2
3
4
5
6
7
8
/* Add formatting based on link type */
.entry-content a[href$=".pdf"]{
background: url(images/pdf.png) no-repeat center right;
padding:10px 33px 10px 0;
color:#FF0000;
}

/* background image can be whatever you want, just make sure you adjust padding to accomodate it */
https://snipt.net/embed/845d9d176391c13cd438e00dba2d9e18/
/raw/845d9d176391c13cd438e00dba2d9e18/
845d9d176391c13cd438e00dba2d9e18
text
Text only
8
2019-06-22T07:14:05
True
False
False
May 04, 2014 at 03:27 PM
/api/public/snipt/134724/
format-a-link-based-on-it-linking-to-a-pdf-04e7b6e1
<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></span><span id="L-1"><a name="L-1"></a>/* Add formatting based on link type */ </span><span id="L-2"><a name="L-2"></a>.entry-content a[href$=&quot;.pdf&quot;]{ </span><span id="L-3"><a name="L-3"></a>background: url(images/pdf.png) no-repeat center right; </span><span id="L-4"><a name="L-4"></a>padding:10px 33px 10px 0; </span><span id="L-5"><a name="L-5"></a>color:#FF0000; </span><span id="L-6"><a name="L-6"></a>} </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>/* background image can be whatever you want, just make sure you adjust padding to accomodate it */ </span></pre></div> </td></tr></table>
"auto formatting", classes, css, wordpress

PHP

wordpress is page

1
2
3
4
5
<?php 
if( is_page($page) ){
     //код
}
?>
https://snipt.net/embed/0357f38bb53492868a92989e8814b625/
/raw/0357f38bb53492868a92989e8814b625/
0357f38bb53492868a92989e8814b625
php
PHP
5
2019-06-22T06:51:34
True
False
False
Mar 22, 2014 at 08:30 PM
/api/public/snipt/123971/
wordpress-is-page
<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></span><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="k">if</span><span class="p">(</span> <span class="nx">is_page</span><span class="p">(</span><span class="nv">$page</span><span class="p">)</span> <span class="p">){</span> </span><span id="L-3"><a name="L-3"></a> <span class="c1">//код</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span><span id="L-5"><a name="L-5"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
wordpress, wp

PHP

wordpress include plugin

include_once('advanced-custom-fields/acf.php');
https://snipt.net/embed/135c50ff60836ab7899efbb97cc4f9e7/
/raw/135c50ff60836ab7899efbb97cc4f9e7/
135c50ff60836ab7899efbb97cc4f9e7
php
PHP
1
2019-06-22T19:06:10
True
False
False
/api/public/snipt/123944/
wordpress-include-plugin
<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></span><span id="L-1"><a name="L-1"></a><span class="x">include_once(&#39;advanced-custom-fields/acf.php&#39;);</span> </span></pre></div> </td></tr></table>
plugin, wordpress, wp