snipt

Ctrl+h for KB shortcuts

HTML+PHP

the thumbnail

1
2
3
4
5
6
7
<div class='alignleft'>
<?php
	if ( has_post_thumbnail() ) {
		the_post_thumbnail( 'sp-thumbnail' );
	}
?>
</div>
https://snipt.net/embed/603e56d1dbfe901cd77c2f7189ee944b/
https://snipt.net/raw/603e56d1dbfe901cd77c2f7189ee944b/
603e56d1dbfe901cd77c2f7189ee944b
html+php
HTML+PHP
7
2016-09-08T01:02:00
True
False
False
/api/public/snipt/28424/
the-thumbnail
<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="nt">&lt;div</span> <span class="na">class=</span><span class="s">&#39;alignleft&#39;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="cp">&lt;?php</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">if</span> <span class="p">(</span> <span class="nx">has_post_thumbnail</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="nx">the_post_thumbnail</span><span class="p">(</span> <span class="s1">&#39;sp-thumbnail&#39;</span> <span class="p">);</span> </span><span id="L-5"><a name="L-5"></a> <span class="p">}</span> </span><span id="L-6"><a name="L-6"></a><span class="cp">?&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="nt">&lt;/div&gt;</span> </span></pre></div> </td></tr></table>
staypress, wordpress

HTML+PHP

setup thumbnails

1
2
3
4
5
6
<?php
// add the thumbnail support
add_theme_support( 'post-thumbnails' );
// then ensure we have a nice sized thumbnail for our listing
add_image_size( 'sp-thumbnail', 150, 150 );
?>
https://snipt.net/embed/e511ba4bc51a7cb57a190ccdec738845/
https://snipt.net/raw/e511ba4bc51a7cb57a190ccdec738845/
e511ba4bc51a7cb57a190ccdec738845
html+php
HTML+PHP
6
2016-09-06T22:18:13
True
False
False
/api/public/snipt/28423/
setup-thumbnails
<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 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="c1">// add the thumbnail support</span> </span><span id="L-3"><a name="L-3"></a><span class="nx">add_theme_support</span><span class="p">(</span> <span class="s1">&#39;post-thumbnails&#39;</span> <span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">// then ensure we have a nice sized thumbnail for our listing</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">add_image_size</span><span class="p">(</span> <span class="s1">&#39;sp-thumbnail&#39;</span><span class="p">,</span> <span class="mi">150</span><span class="p">,</span> <span class="mi">150</span> <span class="p">);</span> </span><span id="L-6"><a name="L-6"></a><span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
staypress, wordpress

HTML+PHP

post thumbnail

1
2
3
4
5
<?php
if ( has_post_thumbnail() ) {
	the_post_thumbnail();
}
?>
https://snipt.net/embed/5e2a35b5fd9b62d183cab39b08720969/
https://snipt.net/raw/5e2a35b5fd9b62d183cab39b08720969/
5e2a35b5fd9b62d183cab39b08720969
html+php
HTML+PHP
5
2016-09-14T08:39:58
True
False
False
/api/public/snipt/28422/
post-thumbnail
<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 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="nx">has_post_thumbnail</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">the_post_thumbnail</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></pre></div> </td></tr></table>
staypress, wordpress

HTML+PHP

property meta

<?php echo do_shortcode("[propertymeta property='post' item='p' itemclass='alignleft' meta='Bedrooms' namepostfix=' : ' default='0' showname='yes']"); ?>
<?php echo do_shortcode("[propertymeta property='post' item='p' itemclass='alignright' meta='Bathrooms' namepostfix=' : ' default='0' showname='yes']"); ?>
https://snipt.net/embed/9bb09283769093f4cdd3ea9c0d290e32/
https://snipt.net/raw/9bb09283769093f4cdd3ea9c0d290e32/
9bb09283769093f4cdd3ea9c0d290e32
html+php
HTML+PHP
2
2016-08-25T19:46:05
True
False
False
/api/public/snipt/28421/
property-meta
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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="k">echo</span> <span class="nx">do_shortcode</span><span class="p">(</span><span class="s2">&quot;[propertymeta property=&#39;post&#39; item=&#39;p&#39; itemclass=&#39;alignleft&#39; meta=&#39;Bedrooms&#39; namepostfix=&#39; : &#39; default=&#39;0&#39; showname=&#39;yes&#39;]&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nx">do_shortcode</span><span class="p">(</span><span class="s2">&quot;[propertymeta property=&#39;post&#39; item=&#39;p&#39; itemclass=&#39;alignright&#39; meta=&#39;Bathrooms&#39; namepostfix=&#39; : &#39; default=&#39;0&#39; showname=&#39;yes&#39;]&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
staypress

HTML

footer meta before

1
2
3
<footer class="entry-meta">

</footer><!-- #entry-meta -->
https://snipt.net/embed/188a0e97c7011f4ff316608f1b6ced4b/
https://snipt.net/raw/188a0e97c7011f4ff316608f1b6ced4b/
188a0e97c7011f4ff316608f1b6ced4b
html
HTML
3
2016-09-18T09:00:21
True
False
False
/api/public/snipt/28417/
footer-meta-before
<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 id="L-1"><a name="L-1"></a><span class="nt">&lt;footer</span> <span class="na">class=</span><span class="s">&quot;entry-meta&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/footer&gt;</span><span class="c">&lt;!-- #entry-meta --&gt;</span> </span></pre></div> </td></tr></table>
staypress

HTML+PHP

Property location

<strong>Location</strong> : <?php echo do_shortcode("[propertycountry property='post' itemislink='yes' postfix=' &gt;'] [propertyregion property='post' itemislink='yes' postfix=' &gt;'] [propertytown property='post' itemislink='yes']"); ?>
https://snipt.net/embed/b8bfa923787a8403ca852d88b72fca96/
https://snipt.net/raw/b8bfa923787a8403ca852d88b72fca96/
b8bfa923787a8403ca852d88b72fca96
html+php
HTML+PHP
1
2016-09-28T02:19:44
True
False
False
/api/public/snipt/28416/
property-location
<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 id="L-1"><a name="L-1"></a><span class="nt">&lt;strong&gt;</span>Location<span class="nt">&lt;/strong&gt;</span> : <span class="cp">&lt;?php</span> <span class="k">echo</span> <span class="nx">do_shortcode</span><span class="p">(</span><span class="s2">&quot;[propertycountry property=&#39;post&#39; itemislink=&#39;yes&#39; postfix=&#39; &amp;gt;&#39;] [propertyregion property=&#39;post&#39; itemislink=&#39;yes&#39; postfix=&#39; &amp;gt;&#39;] [propertytown property=&#39;post&#39; itemislink=&#39;yes&#39;]&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
staypress
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.