snipt

Ctrl+h for KB shortcuts
#35120

PHP

simplefields orbit slider

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/08b1cc29ab5c71b772dd8c3062c53250/
https://snipt.net/raw/08b1cc29ab5c71b772dd8c3062c53250/
08b1cc29ab5c71b772dd8c3062c53250
php
PHP
7
2014-04-12T23:02:09
True
False
/api/public/snipt/35120/
simplefields-orbit-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> <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 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>
orbit, simplefields, wordpress, zurb