<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: WordPress How To: Latest Posts by Category Archive</title>
	<atom:link href="http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/</link>
	<description>Visit Blogsessive for daily WordPress blogging tips.</description>
	<lastBuildDate>Sat, 07 Apr 2012 20:31:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: yalon</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-411400</link>
		<dc:creator>yalon</dc:creator>
		<pubDate>Tue, 18 Oct 2011 11:28:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-411400</guid>
		<description>Thanks！</description>
		<content:encoded><![CDATA[<p>Thanks！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-410515</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 20 Jul 2011 02:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-410515</guid>
		<description>Thank you so much for this tutorial! This is the only good post I found showing how to do this without a plugin.

By the way, &amp;showposts has been depreciated. It was replaced by &amp;posts_per_page. Simply swapping those two items out should help bring the code up-to-date. 

It&#039;s also worth noting that it&#039;s possible to show an unlimited number of posts under each category by setting &amp;posts_per_page=-1.</description>
		<content:encoded><![CDATA[<p>Thank you so much for this tutorial! This is the only good post I found showing how to do this without a plugin.</p>
<p>By the way, &amp;showposts has been depreciated. It was replaced by &amp;posts_per_page. Simply swapping those two items out should help bring the code up-to-date. </p>
<p>It&#8217;s also worth noting that it&#8217;s possible to show an unlimited number of posts under each category by setting &amp;posts_per_page=-1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex, Blogsessive</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-406773</link>
		<dc:creator>Alex, Blogsessive</dc:creator>
		<pubDate>Mon, 02 May 2011 07:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-406773</guid>
		<description>shamil, this is not a &quot;browser specific&quot; piece of code. Most of the code is PHP, and DB queries. There is not cross-browser issue here. If you&#039;re experiencing any problems with IE display, that might just come from your theme&#039;s design and CSS styling. Just in case, you could simply play with the floats and overflow in the CSS of the tutorial, but I doubt that would be the issue.</description>
		<content:encoded><![CDATA[<p>shamil, this is not a &#8220;browser specific&#8221; piece of code. Most of the code is PHP, and DB queries. There is not cross-browser issue here. If you&#8217;re experiencing any problems with IE display, that might just come from your theme&#8217;s design and CSS styling. Just in case, you could simply play with the floats and overflow in the CSS of the tutorial, but I doubt that would be the issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shamil</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-406764</link>
		<dc:creator>shamil</dc:creator>
		<pubDate>Mon, 02 May 2011 07:20:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-406764</guid>
		<description>its not workin in IE.
:S
any suggestions Alex ?</description>
		<content:encoded><![CDATA[<p>its not workin in IE.<br />
:S<br />
any suggestions Alex ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atif</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-403368</link>
		<dc:creator>Atif</dc:creator>
		<pubDate>Sun, 24 Apr 2011 11:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-403368</guid>
		<description>Great wordpress hack to see here</description>
		<content:encoded><![CDATA[<p>Great wordpress hack to see here</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mustamar Natsir</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-376152</link>
		<dc:creator>Mustamar Natsir</dc:creator>
		<pubDate>Sat, 05 Mar 2011 16:53:03 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-376152</guid>
		<description>This is the most valuable WP tutorial I found today.

This gives me a lot of new ideas in exploring WP.

Thanks.</description>
		<content:encoded><![CDATA[<p>This is the most valuable WP tutorial I found today.</p>
<p>This gives me a lot of new ideas in exploring WP.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-348966</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 04 Feb 2011 03:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-348966</guid>
		<description>Has anyone figured out how to use this along with custom post types for WP 3+ ?? 

Any ideas would be awesome!

Thanks -
Dan</description>
		<content:encoded><![CDATA[<p>Has anyone figured out how to use this along with custom post types for WP 3+ ?? </p>
<p>Any ideas would be awesome!</p>
<p>Thanks -<br />
Dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angie</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-273457</link>
		<dc:creator>Angie</dc:creator>
		<pubDate>Sun, 19 Dec 2010 02:43:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-273457</guid>
		<description>Thank you! That was exactly what I was looking for. And the css was icing on the cake!</description>
		<content:encoded><![CDATA[<p>Thank you! That was exactly what I was looking for. And the css was icing on the cake!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-202483</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Mon, 18 Oct 2010 16:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-202483</guid>
		<description>Hi all,
i&#039;m building my own wordpress theme and i&#039;d like to show some random posts by 12 little pics in the homepage.
This is the code i tried to do and it works fine. The problem is that i wanto to EXCLUDE a specific category. How can i modify the code?
Can anyone help me?

Thanks in advance.

Max

This is the code i used:


    
    
    
    
    
    get_results(&quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_status = &#039;publish&#039; AND post_type = &#039;post&#039; ORDER BY RAND() LIMIT 12&quot;); 

		foreach ($randompost as $post) { 	
			$ID = $post-&gt;ID;
            $postid = get_post($post-&gt;ID); 
            $title = $postid-&gt;post_title;
            $values = $wpdb-&gt;get_var(&quot;SELECT meta_value FROM $wpdb-&gt;postmeta WHERE post_id = $ID AND meta_key = &#039;Image&#039; &quot;);
            ?&gt;	
    
    

	
		&lt;a href=&quot;&quot; rel=&quot;bookmark&quot; title=&quot;&quot;&gt;&lt;img src=&quot;/scripts/timthumb.php?src=/&amp;w=&amp;h=&amp;zc=1&amp;q=100&quot;
alt=&quot;&quot; class=&quot;left&quot; width=&quot;px&quot; height=&quot;px&quot;  /&gt;&lt;/a&gt;
		

	

	ID;
$the_content =$wpdb-&gt;get_var(&quot;SELECT post_content FROM $wpdb-&gt;posts WHERE ID = $id&quot;);
$home = get_option(&#039;home&#039;);
$pattern = &#039;!
				
	&lt;a href=&quot;&quot; rel=&quot;bookmark&quot; title=&quot;&quot;&gt;
&lt;img src=&quot;/scripts/timthumb.php?src=&amp;w=&amp;h=&amp;zc=1&amp;q=100&quot;
    alt=&quot;&quot; class=&quot;left&quot; width=&quot;px&quot; height=&quot;px&quot;  /&gt;&lt;/a&gt;

	
        
		
    &lt;a href=&quot;location.reload()&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;
        
    </description>
		<content:encoded><![CDATA[<p>Hi all,<br />
i&#8217;m building my own wordpress theme and i&#8217;d like to show some random posts by 12 little pics in the homepage.<br />
This is the code i tried to do and it works fine. The problem is that i wanto to EXCLUDE a specific category. How can i modify the code?<br />
Can anyone help me?</p>
<p>Thanks in advance.</p>
<p>Max</p>
<p>This is the code i used:</p>
<p>    get_results(&#8220;SELECT ID FROM $wpdb-&gt;posts WHERE post_status = &#8216;publish&#8217; AND post_type = &#8216;post&#8217; ORDER BY RAND() LIMIT 12&#8243;); </p>
<p>		foreach ($randompost as $post) {<br />
			$ID = $post-&gt;ID;<br />
            $postid = get_post($post-&gt;ID);<br />
            $title = $postid-&gt;post_title;<br />
            $values = $wpdb-&gt;get_var(&#8220;SELECT meta_value FROM $wpdb-&gt;postmeta WHERE post_id = $ID AND meta_key = &#8216;Image&#8217; &#8220;);<br />
            ?&gt;	</p>
<p>		&lt;a href=&quot;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;"&gt;&lt;img src=&quot;/scripts/timthumb.php?src=/&amp;w=&amp;h=&amp;zc=1&amp;q=100&#8243;<br />
alt=&#8221;" class=&#8221;left&#8221; width=&#8221;px&#8221; height=&#8221;px&#8221;  /&gt;</p>
<p>	ID;<br />
$the_content =$wpdb-&gt;get_var(&#8220;SELECT post_content FROM $wpdb-&gt;posts WHERE ID = $id&#8221;);<br />
$home = get_option(&#8216;home&#8217;);<br />
$pattern = &#8216;!</p>
<p>	&lt;a href=&quot;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;"&gt;<br />
&lt;img src=&quot;/scripts/timthumb.php?src=&amp;w=&amp;h=&amp;zc=1&amp;q=100&#8243;<br />
    alt=&#8221;" class=&#8221;left&#8221; width=&#8221;px&#8221; height=&#8221;px&#8221;  /&gt;</p>
<p>    <a href="location.reload()" rel="nofollow"></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lily L</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-193369</link>
		<dc:creator>Lily L</dc:creator>
		<pubDate>Sun, 26 Sep 2010 15:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-193369</guid>
		<description>Is there a way to specific a custom sort order for the categories (i.e. not by name, nor by ID)?

I&#039;m using the &#039;Category Order&#039; plugin (http://wordpress.org/extend/plugins/order-categories/) which let&#039;s me customize the order of how categories are listed, is there a way to order the categories the same order that I specify in the Category Order plugin?

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Is there a way to specific a custom sort order for the categories (i.e. not by name, nor by ID)?</p>
<p>I&#8217;m using the &#8216;Category Order&#8217; plugin (<a href="http://wordpress.org/extend/plugins/order-categories/" rel="nofollow">http://wordpress.org/extend/pl.....ategories/</a>) which let&#8217;s me customize the order of how categories are listed, is there a way to order the categories the same order that I specify in the Category Order plugin?</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-168265</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 29 Jul 2010 09:22:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-168265</guid>
		<description>This is great stuff thanks. However, I&#039;m using this in WordPress 3 and would like to use it with a custom post type and custom taxonomy in place of the blog and category. Any hints would be most appreciated!</description>
		<content:encoded><![CDATA[<p>This is great stuff thanks. However, I&#8217;m using this in WordPress 3 and would like to use it with a custom post type and custom taxonomy in place of the blog and category. Any hints would be most appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew Taylor</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-143558</link>
		<dc:creator>Drew Taylor</dc:creator>
		<pubDate>Thu, 13 May 2010 18:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-143558</guid>
		<description>Thanks!! Helped me a ton!!</description>
		<content:encoded><![CDATA[<p>Thanks!! Helped me a ton!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-128870</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Wed, 07 Apr 2010 05:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-128870</guid>
		<description>Me again,

Just thought I&#039;d mention that the declaration overflow: hidden; breaks Safari 4. I took it out and it still displays fine in Firefox, as well as Safari 4.</description>
		<content:encoded><![CDATA[<p>Me again,</p>
<p>Just thought I&#8217;d mention that the declaration overflow: hidden; breaks Safari 4. I took it out and it still displays fine in Firefox, as well as Safari 4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-126928</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Wed, 31 Mar 2010 00:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-126928</guid>
		<description>I love you. I&#039;ve been fervently trying to figure out how to accomplish this for months. Doesn&#039;t help I&#039;m already mired down in a really complicated loop, but this trick really eases a lot of the pain I&#039;m going to have to go to. You got a donate link around here somewheres?</description>
		<content:encoded><![CDATA[<p>I love you. I&#8217;ve been fervently trying to figure out how to accomplish this for months. Doesn&#8217;t help I&#8217;m already mired down in a really complicated loop, but this trick really eases a lot of the pain I&#8217;m going to have to go to. You got a donate link around here somewheres?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-123628</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Thu, 18 Mar 2010 21:14:53 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-123628</guid>
		<description>Is there a way to get posts older than the current visited article? For example, is the current article id 100, I want 5 posts of the same category with an id lower than 100. I haven&#039;t find a solution for this, maybe someone has a hint for me.</description>
		<content:encoded><![CDATA[<p>Is there a way to get posts older than the current visited article? For example, is the current article id 100, I want 5 posts of the same category with an id lower than 100. I haven&#8217;t find a solution for this, maybe someone has a hint for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A-plus</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-122707</link>
		<dc:creator>A-plus</dc:creator>
		<pubDate>Tue, 16 Mar 2010 17:34:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-122707</guid>
		<description>@ Melvin

You wrote:
Is there a way to sort the categories in orders of ascending, e.g. cat 6, 7, 8, 9 instead of 9, 8, 7, 6 as what I am currently experiencing?

I think this should do the trick,
add some code in the database query:

$catQuery = $wpdb-&gt;get_results(
	&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON 
	( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 
	AND wtaxonomy.count &gt;= 0 AND wterms.term_id NOT IN (38,1) ORDER BY wterms.term_ID DESC&quot;);

And here is a way to sort by catgeory name instead of catgeory ID:

$catQuery = $wpdb-&gt;get_results(
	&quot;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON 
	( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#039;category&#039; AND wtaxonomy.parent = 0 
	AND wtaxonomy.count &gt;= 0 AND wterms.term_id NOT IN (38,1) ORDER BY wterms.name ASC&quot;);</description>
		<content:encoded><![CDATA[<p>@ Melvin</p>
<p>You wrote:<br />
Is there a way to sort the categories in orders of ascending, e.g. cat 6, 7, 8, 9 instead of 9, 8, 7, 6 as what I am currently experiencing?</p>
<p>I think this should do the trick,<br />
add some code in the database query:</p>
<p>$catQuery = $wpdb-&gt;get_results(<br />
	&#8220;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON<br />
	( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#8216;category&#8217; AND wtaxonomy.parent = 0<br />
	AND wtaxonomy.count &gt;= 0 AND wterms.term_id NOT IN (38,1) ORDER BY wterms.term_ID DESC&#8221;);</p>
<p>And here is a way to sort by catgeory name instead of catgeory ID:</p>
<p>$catQuery = $wpdb-&gt;get_results(<br />
	&#8220;SELECT * FROM $wpdb-&gt;terms AS wterms INNER JOIN $wpdb-&gt;term_taxonomy AS wtaxonomy ON<br />
	( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = &#8216;category&#8217; AND wtaxonomy.parent = 0<br />
	AND wtaxonomy.count &gt;= 0 AND wterms.term_id NOT IN (38,1) ORDER BY wterms.name ASC&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Landay</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-114617</link>
		<dc:creator>Bill Landay</dc:creator>
		<pubDate>Wed, 17 Feb 2010 05:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-114617</guid>
		<description>Just a quick thank you. This solution was very, very helpful. I had been pulling my hair out trying to organize my Archives page (at http://williamlanday.com/blog/archives/ ) when I finally found this. Great job.</description>
		<content:encoded><![CDATA[<p>Just a quick thank you. This solution was very, very helpful. I had been pulling my hair out trying to organize my Archives page (at <a href="http://williamlanday.com/blog/archives/" rel="nofollow">http://williamlanday.com/blog/archives/</a> ) when I finally found this. Great job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves&#160;&#124;&#160;web3mantra</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-105959</link>
		<dc:creator>10 WordPress ‘HOW-TO’ to Give Your Blog the Quality it Deserves&#160;&#124;&#160;web3mantra</dc:creator>
		<pubDate>Wed, 13 Jan 2010 11:19:21 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-105959</guid>
		<description>[...] Source: Latest Posts by Category Archive [...]</description>
		<content:encoded><![CDATA[<p>[...] Source: Latest Posts by Category Archive [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [WordPress] カテゴリーアーカイブページテンプレート - ハウスウエディング [665-667]</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-90142</link>
		<dc:creator>[WordPress] カテゴリーアーカイブページテンプレート - ハウスウエディング [665-667]</dc:creator>
		<pubDate>Thu, 19 Nov 2009 17:55:23 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-90142</guid>
		<description>[...] 参考WordPress How To: Latest Posts by Category Archive [...]</description>
		<content:encoded><![CDATA[<p>[...] 参考WordPress How To: Latest Posts by Category Archive [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suszan</title>
		<link>http://blogsessive.com/blogging-tools/latest-posts-by-category-archive/#comment-84126</link>
		<dc:creator>suszan</dc:creator>
		<pubDate>Fri, 30 Oct 2009 02:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogsessive.com/?p=1047#comment-84126</guid>
		<description>I have one problem with my screep i have add codet but i see i have one erro
At my display .

 Please open image and you see whe i have error....
 http://img4.imageshack.us/img4/9054/screenshot004nt.jpg

 I wite for questios

Thanks for all.</description>
		<content:encoded><![CDATA[<p>I have one problem with my screep i have add codet but i see i have one erro<br />
At my display .</p>
<p> Please open image and you see whe i have error&#8230;.<br />
 <a href="http://img4.imageshack.us/img4/9054/screenshot004nt.jpg" rel="nofollow">http://img4.imageshack.us/img4.....t004nt.jpg</a></p>
<p> I wite for questios</p>
<p>Thanks for all.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

