snipt

Ctrl+h for KB shortcuts

Text only

Clean up urls

1
2
3
4
5
6
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L]
https://snipt.net/embed/d27b37233746775b185b4d23606e1174/
/raw/d27b37233746775b185b4d23606e1174/
d27b37233746775b185b4d23606e1174
text
Text only
6
2019-08-22T20:52:15
True
False
False
Nov 28, 2013 at 12:17 PM
/api/public/snipt/97343/
clean-up-urls
<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></span><span id="L-1"><a name="L-1"></a>Options -MultiViews </span><span id="L-2"><a name="L-2"></a>RewriteEngine On </span><span id="L-3"><a name="L-3"></a>RewriteBase / </span><span id="L-4"><a name="L-4"></a>RewriteCond %{REQUEST_FILENAME} !-f </span><span id="L-5"><a name="L-5"></a>RewriteCond %{REQUEST_FILENAME} !-d </span><span id="L-6"><a name="L-6"></a>RewriteRule ^(.*)$ $1.php [L] </span></pre></div> </td></tr></table>
"clean urls", "pretty urls", htaccess

PHP

Get terms on a archive page

1
2
3
4
5
6
7
<?php
    $queried_object = get_queried_object();
    $term_slug = $queried_object->slug;
    
    echo $term_slug;
    
?>
https://snipt.net/embed/ad8e4eb6eb6f5cd505ca91754ba95051/
/raw/ad8e4eb6eb6f5cd505ca91754ba95051/
ad8e4eb6eb6f5cd505ca91754ba95051
php
PHP
7
2019-08-24T15:40:02
True
False
False
Nov 22, 2013 at 07:31 AM
/api/public/snipt/95975/
get-terms-on-a-archive-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> <a href="#L-6">6</a> <a href="#L-7">7</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="nv">$queried_object</span> <span class="o">=</span> <span class="nx">get_queried_object</span><span class="p">();</span> </span><span id="L-3"><a name="L-3"></a> <span class="nv">$term_slug</span> <span class="o">=</span> <span class="nv">$queried_object</span><span class="o">-&gt;</span><span class="na">slug</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="k">echo</span> <span class="nv">$term_slug</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
archive, query, taxonomy, terms, wordpress

PHP

Zebrafy

1
2
3
4
5
<ul>
    <?php foreach ($comments as $int => $comment): ?>
        <li class="<?php echo fmod($int, 2) ? 'even' : 'odd' ?>">
    <?php endforeach; ?>
</ul>
https://snipt.net/embed/ac165ab9a5c31bf12b1759cb93174efa/
/raw/ac165ab9a5c31bf12b1759cb93174efa/
ac165ab9a5c31bf12b1759cb93174efa
php
PHP
5
2019-08-22T20:52:52
True
False
False
Aug 07, 2013 at 06:22 PM
/api/public/snipt/72695/
zebrafy
<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="x">&lt;ul&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="x"> </span><span class="cp">&lt;?php</span> <span class="k">foreach</span> <span class="p">(</span><span class="nv">$comments</span> <span class="k">as</span> <span class="nv">$int</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">)</span><span class="o">:</span> <span class="cp">?&gt;</span><span class="x"></span> </span><span id="L-3"><a name="L-3"></a><span class="x"> &lt;li class=&quot;</span><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nb">fmod</span><span class="p">(</span><span class="nv">$int</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;even&#39;</span> <span class="o">:</span> <span class="s1">&#39;odd&#39;</span> <span class="cp">?&gt;</span><span class="x">&quot;&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> </span><span class="cp">&lt;?php</span> <span class="k">endforeach</span><span class="p">;</span> <span class="cp">?&gt;</span><span class="x"></span> </span><span id="L-5"><a name="L-5"></a><span class="x">&lt;/ul&gt;</span> </span></pre></div> </td></tr></table>
alternate, php, ternary, zebrafy

Text only

Advanced TinyMCE Settings

1
2
3
4
5
6
7
8
Option Name: theme_advanced_buttons2
Value:styleselect,fontsizeselect,formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,hr,undo,redo,wp_help

Option name: theme_advanced_font_sizes
Value: 10px,11px,12px,13px, 14px,16px,18px,20px,22px,24px, 26px, 28px, 30px

Option name: theme_advanced_text_colors
Value: #ccc, #etc
https://snipt.net/embed/620b39f6280a1b21c33d35355c6878c2/
/raw/620b39f6280a1b21c33d35355c6878c2/
620b39f6280a1b21c33d35355c6878c2
text
Text only
8
2019-08-22T20:53:34
True
False
False
/api/public/snipt/60933/
advanced-tinymce-settings
<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>Option Name: theme_advanced_buttons2 </span><span id="L-2"><a name="L-2"></a>Value:styleselect,fontsizeselect,formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,hr,undo,redo,wp_help </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>Option name: theme_advanced_font_sizes </span><span id="L-5"><a name="L-5"></a>Value: 10px,11px,12px,13px, 14px,16px,18px,20px,22px,24px, 26px, 28px, 30px </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>Option name: theme_advanced_text_colors </span><span id="L-8"><a name="L-8"></a>Value: #ccc, #etc </span></pre></div> </td></tr></table>
"Advanced TinyMCE Settings", "editor buttons", wordpress