<?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[Mostrare ultimi attachment di wordpress]]></title><description><![CDATA[<p dir="auto">Ciao ragazzi.</p>
<p dir="auto">Utilizzo il seguente codice per mostrare gli ultimi allegati degli articoli in wordpress:</p>
<pre><code>&lt;?php
$args = array(
 'post_type' =&gt; 'attachment',
 'numberposts' =&gt; 20,
 'post_status' =&gt; null,
 'post_parent' =&gt; null, // any parent
 ); 
$attachments = get_posts($args);
if ($attachments) {
 foreach ($attachments as $post) {
  setup_postdata($post);
  the_attachment_link($post-&gt;ID, false, '', true);
  
 }
}
?&gt;
</code></pre>
<p dir="auto">Uso quindi la funzione <a href="http://codex.wordpress.org/Function_Reference/the_attachment_link" rel="nofollow ugc">the_attachment_link</a> di Wordpress. Mi chiedevo se era possibile filtrare quest lista che viene mostrata in modo da elencare solo gli allegato contenuti in articoli pubblicati e non gli allegati presenti in articoli in bozza o in programmazione.</p>
<p dir="auto">E' possibile?</p>
<p dir="auto">Grazie mille per l'attenzione</p>
]]></description><link>https://dev.connect.gt/topic/127212/mostrare-ultimi-attachment-di-wordpress</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Dec 2026 20:30:22 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/127212.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 May 2010 19:03:44 GMT</pubDate><ttl>60</ttl></channel></rss>