snipt

Ctrl+h for KB shortcuts

PHP

Wordpress modify the current query

1
2
3
4
5
<?php
query_posts(
	array_merge( $wp_query->query, array( 'posts_per_page' => 5 ) )
);
?>
https://snipt.net/embed/957578057b84cd08446a60f1cbb8253f/
/raw/957578057b84cd08446a60f1cbb8253f/
957578057b84cd08446a60f1cbb8253f
php
PHP
5
2019-07-15T17:41:29
True
False
False
/api/public/snipt/57894/
wordpress-modify-the-current-query
<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="nx">query_posts</span><span class="p">(</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">array_merge</span><span class="p">(</span> <span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">query</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span> <span class="s1">&#39;posts_per_page&#39;</span> <span class="o">=&gt;</span> <span class="mi">5</span> <span class="p">)</span> <span class="p">)</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>
query_posts, wordpress

CSS

Create a triangle shape with CSS

1
2
3
4
5
6
7
#triangle { /* right-pointing triangle */
   width: 0; 
   height: 0; 
   border-bottom: 120px solid green; 
   border-left: 60px solid transparent; 
   border-right: 60px solid transparent; 
}
https://snipt.net/embed/5ae95badc6adf8bbb8c999aa752a1bc7/
/raw/5ae95badc6adf8bbb8c999aa752a1bc7/
5ae95badc6adf8bbb8c999aa752a1bc7
css
CSS
7
2019-07-05T21:26:38
True
False
False
/api/public/snipt/40934/
create-a-triangle-shape-with-css
<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="nn">#triangle</span> <span class="p">{</span> <span class="c">/* right-pointing triangle */</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">width</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">height</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">border-bottom</span><span class="o">:</span> <span class="m">120px</span> <span class="nb">solid</span> <span class="nb">green</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a> <span class="nb">border-left</span><span class="o">:</span> <span class="m">60px</span> <span class="nb">solid</span> <span class="nb">transparent</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a> <span class="nb">border-right</span><span class="o">:</span> <span class="m">60px</span> <span class="nb">solid</span> <span class="nb">transparent</span><span class="p">;</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>