<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Query solo post con featured image]]></title><description><![CDATA[<p dir="auto">Ciao a tutti, spero che qualcuno possa aiutarmi: ho il seguente codice che dovrebbe visualizzare in Wordpress solo i post in cui è settata la featured image, invece mi restituisce anche i post in cui non è settata la featured image: (get_option sono le opzioni del tema)</p>
<pre><code>&lt;?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
        the_post_thumbnail(array($theme-&gt;get_option('featured_image_width'), $theme-&gt;get_option('featured_image_height')),array("class" =&gt; $theme-&gt;get_option('featured_image_position') . " featured_image")
                    );

?&gt;
</code></pre>
<p dir="auto">Qualcuno ha idea di come risolvere senza plugin?</p>
<p dir="auto">Grazie.</p>
]]></description><link>https://dev.connect.gt/topic/203689/query-solo-post-con-featured-image</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 01:01:51 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/203689.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Jun 2014 19:51:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Query solo post con featured image on Sun, 06 Jul 2014 21:05:56 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, teoricamente basterebbe escludere i post che non hanno il meta_key _thumbnail_id. Premesso, sempre che tu voglia non mostrare i post che non hanno l'immagine in evidenza da impostazione del post vero e proprio e non da opzione del tema. Ergo:</p>
<pre><code class="language-php">&lt;?php
$args = array( 'meta_key' =&gt; '_thumbnail_id' );$query = new WP_Query( $args );
while ($query-&gt;have_posts()) : $query-&gt;the_post();
?&gt;

// Lopp


&lt;?php endwhile; ?&gt;
&lt;?php wp_reset_query(); ?&gt;
</code></pre>
<p dir="auto">Saluti</p>
]]></description><link>https://dev.connect.gt/post/1165853</link><guid isPermaLink="true">https://dev.connect.gt/post/1165853</guid><dc:creator><![CDATA[all2aller]]></dc:creator><pubDate>Sun, 06 Jul 2014 21:05:56 GMT</pubDate></item></channel></rss>