<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->
<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"
>
	<channel>
		<title>Theme Hybrid Support &#187; Topic: custom posts and categories, old way and new way?</title>
		<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way</link>
		<description>WordPress theme club support forums</description>
		<language>en-US</language>
		<pubDate>Fri, 30 Jul 2010 13:59:04 +0000</pubDate>
		<generator>bbpress 1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://themehybrid.com/support/search.php</link>
		</textInput>
		<atom:link href="http://themehybrid.com/support/rss/topic/custom-posts-and-categories-old-way-and-new-way" rel="self" type="application/rss+xml" />

		<item>
			<title>Justin Tadlock on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-34420</link>
			<pubDate>Mon, 01 Feb 2010 19:40:56 +0000</pubDate>
			<dc:creator>Justin Tadlock</dc:creator>
			<guid isPermaLink="false">34420@http://themehybrid.com/support/</guid>
			<description>&#60;p&#62;Change this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;#39;single_template&#38;#39;, &#38;#39;my_single_template&#38;#39; );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;To:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;#39;single_template&#38;#39;, &#38;#39;my_single_template&#38;#39;, 11 );&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>eddiejanzer on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-34414</link>
			<pubDate>Mon, 01 Feb 2010 15:12:17 +0000</pubDate>
			<dc:creator>eddiejanzer</dc:creator>
			<guid isPermaLink="false">34414@http://themehybrid.com/support/</guid>
			<description>&#60;p&#62;&#60;code&#62;taxonomy-category-news.php&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;post-cat-news.php&#60;/code&#62;, these are the templates I am using in my child theme, along with the code above, although the custom category shows correctly, my post template does not show, it just defaults to &#60;code&#62;post.php&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Justin Tadlock on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-33711</link>
			<pubDate>Fri, 22 Jan 2010 19:12:04 +0000</pubDate>
			<dc:creator>Justin Tadlock</dc:creator>
			<guid isPermaLink="false">33711@http://themehybrid.com/support/</guid>
			<description>&#60;blockquote&#62;&#60;p&#62;
Does this allow me to make a template for my posts to show them differently depending on the category that is selected?
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;Yes, it allows you to make templates for singular posts based on category.&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
I am currently looking to change my layout depending on what category is selected.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;You might want to look into CSS solutions first.  Using a different template should be to change the page's function, not its form (in most cases).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>philmcdonnell on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-33704</link>
			<pubDate>Fri, 22 Jan 2010 18:00:22 +0000</pubDate>
			<dc:creator>philmcdonnell</dc:creator>
			<guid isPermaLink="false">33704@http://themehybrid.com/support/</guid>
			<description>&#60;p&#62;Does this allow me to make a template for my posts to show them differently depending on the category that is selected?&#60;/p&#62;
&#60;p&#62;I am currently looking to change my layout depending on what category is selected.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Phil
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eddiejanzer on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-33654</link>
			<pubDate>Fri, 22 Jan 2010 05:04:17 +0000</pubDate>
			<dc:creator>eddiejanzer</dc:creator>
			<guid isPermaLink="false">33654@http://themehybrid.com/support/</guid>
			<description>&#60;p&#62;good deal, thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Justin Tadlock on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-33645</link>
			<pubDate>Fri, 22 Jan 2010 01:30:19 +0000</pubDate>
			<dc:creator>Justin Tadlock</dc:creator>
			<guid isPermaLink="false">33645@http://themehybrid.com/support/</guid>
			<description>&#60;p&#62;Probably a much cleaner way to do this.  Use &#60;code&#62;post-cat-$slug.php&#60;/code&#62; or &#60;code&#62;post-cat-$id.php&#60;/code&#62; in your child theme folder.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;#39;single_template&#38;#39;, &#38;#39;my_single_template&#38;#39; );

function my_single_template( $template ) {
	global $wp_query;

	$terms = get_the_terms( $wp_query-&#38;gt;post-&#38;gt;ID, &#38;#39;category&#38;#39; );

	if ( isset( $terms ) ) {
		foreach( $terms as $term ) {
			$templates[] = &#38;quot;post-cat-{$term-&#38;gt;slug}.php&#38;quot;;
			$templates[] = &#38;quot;post-cat-{$term-&#38;gt;term_id}&#38;quot;;
		}
	}

	$have_template = locate_template( $templates );

	if ( $have_template )
		$template = $have_template;

	return $template;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;locate_template()&#60;/code&#62; was introduced just after I wrote that tutorial, which makes it much easier.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eddiejanzer on "custom posts and categories, old way and new way?"</title>
			<link>http://themehybrid.com/support/topic/custom-posts-and-categories-old-way-and-new-way#post-33640</link>
			<pubDate>Thu, 21 Jan 2010 23:29:02 +0000</pubDate>
			<dc:creator>eddiejanzer</dc:creator>
			<guid isPermaLink="false">33640@http://themehybrid.com/support/</guid>
			<description>&#60;pre&#62;&#60;code&#62;function structure_disable( $var ) {
	return false;
}
function my_single_template($single) {
	global $wp_query, $post;
	/**
	* Checks for single template by category
	* Check by category slug and ID
	*/
	foreach((array)get_the_category() as $cat) :

		if(file_exists(SINGLE_PATH . &#38;#39;/single-cat-&#38;#39; . $cat-&#38;gt;slug . &#38;#39;.php&#38;#39;))
			return SINGLE_PATH . &#38;#39;/single-cat-&#38;#39; . $cat-&#38;gt;slug . &#38;#39;.php&#38;#39;;

		elseif(file_exists(SINGLE_PATH . &#38;#39;/single-cat-&#38;#39; . $cat-&#38;gt;term_id . &#38;#39;.php&#38;#39;))
			return SINGLE_PATH . &#38;#39;/single-cat-&#38;#39; . $cat-&#38;gt;term_id . &#38;#39;.php&#38;#39;;

	endforeach;
	/**
	* Checks for default single post files within the single folder
	*/
	if(file_exists(SINGLE_PATH . &#38;#39;/single.php&#38;#39;))
		return SINGLE_PATH . &#38;#39;/single.php&#38;#39;;

	elseif(file_exists(SINGLE_PATH . &#38;#39;/default.php&#38;#39;))
		return SINGLE_PATH . &#38;#39;/default.php&#38;#39;;
			return $single;

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The above is what I learned on one of your posts Justin. I really like doing it this way because a custom post does not have to be chosen. Would i change &#34;single.php&#34; to &#34;post.php&#34; here and it still work ok with the new hybrid?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
