<?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>Oracle of ONE1 &#187; submenu</title>
	<atom:link href="http://dvector.com/oracle/tag/submenu/feed/" rel="self" type="application/rss+xml" />
	<link>http://dvector.com/oracle</link>
	<description>Obscure words of unity</description>
	<lastBuildDate>Wed, 31 Aug 2011 21:25:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Categories Sub-menu</title>
		<link>http://dvector.com/oracle/2008/07/16/categories-sub-menu/</link>
		<comments>http://dvector.com/oracle/2008/07/16/categories-sub-menu/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 19:09:23 +0000</pubDate>
		<dc:creator>one1</dc:creator>
				<category><![CDATA[dvector]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[dvector support]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[submenu]]></category>

		<guid isPermaLink="false">http://dvector.com/oracle/?p=53</guid>
		<description><![CDATA[This is a very simple version of a Categories sub-menu implemented in the sidebar.php. Once a category is clicked, the sidebar should show the following:

Category description (this is useful other than the sidebar)
Children categories
Posts in the category


Clicking on any category causes this menu to display all posts within that category. I generally try to stay [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very simple version of a Categories sub-menu implemented in the sidebar.php. Once a category is clicked, the sidebar should show the following:</p>
<ol>
<li>Category description (this is useful other than the sidebar)</li>
<li>Children categories</li>
<li>Posts in the category</li>
</ol>
<p><span id="more-53"></span></p>
<p>Clicking on any category causes this menu to display all posts within that category. I generally try to stay away from children categories but children categories may also be displayed.</p>
<pre>/* If this is a category archive
*  This is a continuation of the if - elseif
*  sequence from the default template sidebar.php
*/
&lt;?php  } elseif (is_category()) { ?&gt;
&lt;?php $current_category = single_cat_title(”, false); ?&gt;
&lt;?php $category_id = get_cat_ID($current_category); ?&gt;
&lt;li&gt;&lt;h2&gt;Description of &lt;?php echo $current_category; ?&gt;&lt;/h2&gt;
	&lt;p&gt;&lt;?php echo category_description($category_id); ?&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h2&gt;Children of &lt;?php echo $current_category; ?&gt;&lt;/h2&gt;
	&lt;ul&gt;
	&lt;?php wp_list_categories('orderby=name&amp;show_count=1&amp;hierarchical=0&amp;title_li=&amp;use_desc_for_title=0&amp;child_of='. $category_id); ?&gt;
	&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h2&gt;Posts in &lt;?php echo $current_category; ?&gt;&lt;/h2&gt;
&lt;ul&gt;
	&lt;?php while (have_posts()) : the_post(); ?&gt;
		&lt;li&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="Permanent Link to &lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;?php endwhile; ?&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;?php } ?&gt;</pre>
<h2>What is going on here?</h2>
<p>First we check to see if we are working with a category. If yes, we proceed. Next we assign the category name and the category ID to PHP variables. Then using some template tags and basic formatting, we output the category&#8217;s Description, Children, and Posts.</p>
<h2>References:</h2>
<ul>
<li><a title="wp_list_categories" href="http://codex.wordpress.org/Template_Tags/wp_list_categories">http://codex.wordpress.org/Template_Tags/wp_list_categories</a></li>
<li><a title="single_cat_title" href="http://codex.wordpress.org/Template_Tags/single_cat_title">http://codex.wordpress.org/Template_Tags/single_cat_title</a></li>
<li><a title="category_description" href="http://codex.wordpress.org/Template_Tags/category_description">http://codex.wordpress.org/Template_Tags/category_description</a></li>
<li><a title="Function_Reference" href="http://codex.wordpress.org/Function_Reference">http://codex.wordpress.org/Function_Reference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dvector.com/oracle/2008/07/16/categories-sub-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

