<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Display last post Archives - Nick Shaw</title>
	<atom:link href="https://www.nick-shaw.co.uk/tag/display-last-post/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description></description>
	<lastBuildDate>Tue, 15 Feb 2011 20:48:23 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">150481139</site>	<item>
		<title>WordPress Display last post and image from specific category</title>
		<link>https://www.nick-shaw.co.uk/wordpress-display-last-post-and-image-from-specific-category/</link>
					<comments>https://www.nick-shaw.co.uk/wordpress-display-last-post-and-image-from-specific-category/#respond</comments>
		
		<dc:creator><![CDATA[Nick]]></dc:creator>
		<pubDate>Tue, 15 Feb 2011 20:48:23 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Display last post]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://www.nick-shaw.co.uk/code/?p=29</guid>

					<description><![CDATA[<p>Used to display the last post and image from a specific category, this can be useful for latest news on a homepage or latest posts in a sidebar.</p>
<p>The post <a href="https://www.nick-shaw.co.uk/wordpress-display-last-post-and-image-from-specific-category/">WordPress Display last post and image from specific category</a> appeared first on <a href="https://www.nick-shaw.co.uk">Nick Shaw</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Used to display the last post and image from a specific category, this can be useful for latest news on a homepage or latest posts in a sidebar.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
query_posts('cat=3&amp;#038;showposts=1'); // replace 123 by category ID of &quot;Headline&quot;  
if(have_posts()) : the_post(); $images = get_children(array( 'post_parent' =  --&gt; get_the_id(),
'post_type' =&amp;gt; 'attachment',
'post_mime_type' =&amp;gt; 'image',
'orderby' =&amp;gt; 'ID',
'order' =&amp;gt; 'ASC',
'numberposts' =&amp;gt; 1
));
foreach((array)$images as $key =&amp;gt; $image){
echo wp_get_attachment_image($key);
}
the_title();
the_excerpt();
endif;
wp_reset_query();
?&gt;
</pre>
<p>The post <a href="https://www.nick-shaw.co.uk/wordpress-display-last-post-and-image-from-specific-category/">WordPress Display last post and image from specific category</a> appeared first on <a href="https://www.nick-shaw.co.uk">Nick Shaw</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nick-shaw.co.uk/wordpress-display-last-post-and-image-from-specific-category/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">845</post-id>	</item>
	</channel>
</rss>
