snipt

Ctrl+h for KB shortcuts

PHP

Display Post Divider Between Posts

1
2
3
4
5
6
7
<?php
if (($wp_query->current_post + 1) < ($wp_query->post_count)) {
   echo '<div class="post-item-divider">Post Divider</div>';
}
?>

//Found at: http://css-tricks.com/snippets/wordpress/post-divider/
https://snipt.net/embed/cd27e13121f5b36b8fc31ec2bdacf3d6/
/raw/cd27e13121f5b36b8fc31ec2bdacf3d6/
cd27e13121f5b36b8fc31ec2bdacf3d6
php
PHP
7
2019-07-20T15:42:25
True
False
False
Jan 21, 2013 at 08:13 AM
/api/public/snipt/54135/
display-post-divider-between-posts
<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="k">if</span> <span class="p">((</span><span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">current_post</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">&lt;</span> <span class="p">(</span><span class="nv">$wp_query</span><span class="o">-&gt;</span><span class="na">post_count</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="s1">&#39;&lt;div class=&quot;post-item-divider&quot;&gt;Post Divider&lt;/div&gt;&#39;</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><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="x">//Found at: http://css-tricks.com/snippets/wordpress/post-divider/</span> </span></pre></div> </td></tr></table>
styling, wordpress

CSS

Remove Safari's default styling from the inputs.

1
2
3
input, textarea, select {
   -webkit-appearance: none;
}
https://snipt.net/embed/5c73777d42a1aacb2da5eba7f7299249/
/raw/5c73777d42a1aacb2da5eba7f7299249/
5c73777d42a1aacb2da5eba7f7299249
css
CSS
3
2019-07-19T15:36:42
True
False
False
/api/public/snipt/19574/
remove-safaris-default-styling-from-the-inputs
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">input</span><span class="o">,</span> <span class="nt">textarea</span><span class="o">,</span> <span class="nt">select</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="o">-</span><span class="n">webkit</span><span class="o">-</span><span class="n">appearance</span><span class="o">:</span> <span class="nb">none</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, inputs, safari, styling