Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

One Line Slider

1
2
3
setInterval(function() {
    jQuery('div#mini-slider-front ul li:first-child').appendTo('div#mini-slider-front ul');
}, 5000);
https://snipt.net/embed/3c9768826f4b7ce6a481d8bcb1811ab4/
https://snipt.net/raw/3c9768826f4b7ce6a481d8bcb1811ab4/
3c9768826f4b7ce6a481d8bcb1811ab4
text
Text only
3
2016-12-04T08:56:19
True
False
False
Sep 01, 2012 at 10:45 PM
/api/public/snipt/46591/
one-line-slider
<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>setInterval(function() { </span><span id="L-2"><a name="L-2"></a> jQuery(&#39;div#mini-slider-front ul li:first-child&#39;).appendTo(&#39;div#mini-slider-front ul&#39;); </span><span id="L-3"><a name="L-3"></a>}, 5000); </span></pre></div> </td></tr></table>
jquery, simple, slider

HTML

Slider - HTML

1
2
3
4
5
6
7
<!--
Add this to an HTML module with the custom class "HomeSlider"
-->
<img src="../slide1.jpg" />
<img src="../slide2.jpg" />
<img src="../slide3.jpg" />
<img src="../slide4.jpg" />
https://snipt.net/embed/5e40a25a086f263539256fd46f511764/
https://snipt.net/raw/5e40a25a086f263539256fd46f511764/
5e40a25a086f263539256fd46f511764
html
HTML
7
2016-12-03T19:13:44
True
False
False
/api/public/snipt/35177/
slider-html
<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="c">&lt;!--</span> </span><span id="L-2"><a name="L-2"></a><span class="c">Add this to an HTML module with the custom class &quot;HomeSlider&quot;</span> </span><span id="L-3"><a name="L-3"></a><span class="c">--&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../slide1.jpg&quot;</span> <span class="p">/&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../slide2.jpg&quot;</span> <span class="p">/&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../slide3.jpg&quot;</span> <span class="p">/&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../slide4.jpg&quot;</span> <span class="p">/&gt;</span> </span></pre></div> </td></tr></table>
html, slider

PHP

simplefields slide image

1
2
3
4
5
6
7
<?php $sliderID = $post->ID;
$slider = simple_fields_get_post_group_values($sliderID, "slide image", false, 2);
				
foreach ($slider as $value) {
echo wp_get_attachment_image($value[1], $size='full');
}
?>
https://snipt.net/embed/99324c7c117cd6b4aff08ba73ef5478b/
https://snipt.net/raw/99324c7c117cd6b4aff08ba73ef5478b/
99324c7c117cd6b4aff08ba73ef5478b
php
PHP
7
2016-12-04T17:46:41
True
False
False
/api/public/snipt/35055/
simplefields-slide-image
<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 class="nv">$sliderID</span> <span class="o">=</span> <span class="nv">$post</span><span class="o">-&gt;</span><span class="na">ID</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$slider</span> <span class="o">=</span> <span class="nx">simple_fields_get_post_group_values</span><span class="p">(</span><span class="nv">$sliderID</span><span class="p">,</span> <span class="s2">&quot;slide image&quot;</span><span class="p">,</span> <span class="k">false</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="k">foreach</span> <span class="p">(</span><span class="nv">$slider</span> <span class="k">as</span> <span class="nv">$value</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a><span class="k">echo</span> <span class="nx">wp_get_attachment_image</span><span class="p">(</span><span class="nv">$value</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nv">$size</span><span class="o">=</span><span class="s1">&#39;full&#39;</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </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>
"simplefields plugin", slider, wordpress
Copyrighted, illegal, or inappropriate content? Email [email protected].