snipt

Ctrl+h for KB shortcuts

Text only

if article is tagged gites-de-france, show image in loop

1
2
3
<?php if ( has_tag( 'gites-de-france' ) ) {
    echo '<img src="img-path.png" alt="xxx" title="x">';
}  ?>
https://snipt.net/embed/656d0e0f075785b7c9e7eed7a1e09a63/
/raw/656d0e0f075785b7c9e7eed7a1e09a63/
656d0e0f075785b7c9e7eed7a1e09a63
text
Text only
3
2019-06-25T02:35:03
True
False
False
Jun 13, 2013 at 06:25 AM
/api/public/snipt/64071/
if-article-is-tagged-gites-de-france-show-image-in-loop
<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>&lt;?php if ( has_tag( &#39;gites-de-france&#39; ) ) { </span><span id="L-2"><a name="L-2"></a> echo &#39;&lt;img src=&quot;img-path.png&quot; alt=&quot;xxx&quot; title=&quot;x&quot;&gt;&#39;; </span><span id="L-3"><a name="L-3"></a>} ?&gt; </span></pre></div> </td></tr></table>
"image for tag", loop, wordpress

Text only

Teaser in der Ecke oben

1
2
3
4
5
6
7
Nur für grosse Bildschirme : 

@media only screen and (max-width: 1799px) {
	div#indesignWorkshop { display: none; }
}
@media only screen and (min-width: 1800px) {
	div#indesignWorkshop { display: block; width: 250px; height: 250px; background: url(images/teaser-indesignws.png) 0 0; position: fixed; top:0; left:0; text-indent: -9999px; }
https://snipt.net/embed/7cfc79b7e004997cfd7e3489062386a0/
/raw/7cfc79b7e004997cfd7e3489062386a0/
7cfc79b7e004997cfd7e3489062386a0
text
Text only
7
2019-06-23T19:38:55
True
False
False
Nov 28, 2012 at 12:38 PM
/api/public/snipt/50906/
teaser-in-der-ecke-oben
<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>Nur für grosse Bildschirme : </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>@media only screen and (max-width: 1799px) { </span><span id="L-4"><a name="L-4"></a> div#indesignWorkshop { display: none; } </span><span id="L-5"><a name="L-5"></a>} </span><span id="L-6"><a name="L-6"></a>@media only screen and (min-width: 1800px) { </span><span id="L-7"><a name="L-7"></a> div#indesignWorkshop { display: block; width: 250px; height: 250px; background: url(images/teaser-indesignws.png) 0 0; position: fixed; top:0; left:0; text-indent: -9999px; } </span></pre></div> </td></tr></table>
css, fixed, teaser

Text only

CSS Background for photos

1
2
3
4
5
6
body { 
	background-image: url('http://xxxx.jpg');
	background-attachment: fixed;
	background-position: center top;
	background-size: cover !important;
 }
https://snipt.net/embed/2daab188f82e253ce00066dcfe7b0b1c/
/raw/2daab188f82e253ce00066dcfe7b0b1c/
2daab188f82e253ce00066dcfe7b0b1c
text
Text only
6
2019-06-23T19:39:03
True
False
False
/api/public/snipt/50876/
css-background-for-photos
<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>body { </span><span id="L-2"><a name="L-2"></a> background-image: url(&#39;http://xxxx.jpg&#39;); </span><span id="L-3"><a name="L-3"></a> background-attachment: fixed; </span><span id="L-4"><a name="L-4"></a> background-position: center top; </span><span id="L-5"><a name="L-5"></a> background-size: cover !important; </span><span id="L-6"><a name="L-6"></a> } </span></pre></div> </td></tr></table>
background-image, css

Text only

integrate shortcode responsive slider as template tag

<?php do_shortcode('[responsive_slider]'); ?>
https://snipt.net/embed/33d7d065912ac1f2879f4e01a85349d0/
/raw/33d7d065912ac1f2879f4e01a85349d0/
33d7d065912ac1f2879f4e01a85349d0
text
Text only
1
2019-06-23T19:39:10
True
False
False
Aug 21, 2012 at 11:56 AM
/api/public/snipt/46054/
integrate-shortcode-responsive-slider-as-template-tag
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php do_shortcode(&#39;[responsive_slider]&#39;); ?&gt; </span></pre></div> </td></tr></table>
"responsive slider", shortcode, wordpress

Text only

smart archives output category specifies in meta field

1
2
3
4
5
6
<?php $catid = get_post_meta($post->ID, 'categorie-des-actus', $single = true); 
		if(isset($catid) && $catid!="" ) {
			$wert = "format=list&include_cat=";
			$wert .= "$catid"; 
			smart_archives($wert);
		} ?>
https://snipt.net/embed/62ca8d5645e5ebc2677dee36fa6ec5e1/
/raw/62ca8d5645e5ebc2677dee36fa6ec5e1/
62ca8d5645e5ebc2677dee36fa6ec5e1
text
Text only
6
2019-06-23T19:39:19
True
False
False
/api/public/snipt/46036/
smart-archives-output-category-specifies-in-meta-field
<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>&lt;?php $catid = get_post_meta($post-&gt;ID, &#39;categorie-des-actus&#39;, $single = true); </span><span id="L-2"><a name="L-2"></a> if(isset($catid) &amp;&amp; $catid!=&quot;&quot; ) { </span><span id="L-3"><a name="L-3"></a> $wert = &quot;format=list&amp;include_cat=&quot;; </span><span id="L-4"><a name="L-4"></a> $wert .= &quot;$catid&quot;; </span><span id="L-5"><a name="L-5"></a> smart_archives($wert); </span><span id="L-6"><a name="L-6"></a> } ?&gt; </span></pre></div> </td></tr></table>
"smart archives", wordpress

Text only

Output meta field

<?php echo get_post_meta($post->ID, 'meta-name', $single = true); ?>
https://snipt.net/embed/f2d2f40baf1d928f989c1a85f303e380/
/raw/f2d2f40baf1d928f989c1a85f303e380/
f2d2f40baf1d928f989c1a85f303e380
text
Text only
1
2019-06-23T19:39:25
True
False
False
Aug 21, 2012 at 08:42 AM
/api/public/snipt/46032/
output-meta-field
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php echo get_post_meta($post-&gt;ID, &#39;meta-name&#39;, $single = true); ?&gt; </span></pre></div> </td></tr></table>
meta, wordpress

Text only

smart archives template tag

<?php smart_archives('format=list&include_cat=5'); ?>
https://snipt.net/embed/820ab1c70fa97d3e4ef8758650435231/
/raw/820ab1c70fa97d3e4ef8758650435231/
820ab1c70fa97d3e4ef8758650435231
text
Text only
1
2019-06-25T22:24:42
True
False
False
Aug 21, 2012 at 08:26 AM
/api/public/snipt/46029/
smart-archives-template-tag
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;?php smart_archives(&#39;format=list&amp;include_cat=5&#39;); ?&gt; </span></pre></div> </td></tr></table>
"smart archives", wordpress