<?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/"
>

<channel>
<title>ThemeShaper Forums Topic: Custom post title class Based on Category</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Thu, 23 May 2013 01:15:15 +0000</pubDate>

<item>
<title>almour on "Custom post title class Based on Category"</title>
<link>http://themeshaper.com/forums/topic/custom-post-title-class-based-on-category#post-17148</link>
<pubDate>Sat, 20 Nov 2010 08:30:44 +0000</pubDate>
<dc:creator>almour</dc:creator>
<guid isPermaLink="false">17148@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Thank you!&#60;/p&#62;
&#60;p&#62;You are right. Just a little correction though, it is h1 instead of h2.. makes me wonder.. (I also thought it is suppose to be h2)
&#60;/p&#62;</description>
</item>
<item>
<title>Vasudeva Adiga on "Custom post title class Based on Category"</title>
<link>http://themeshaper.com/forums/topic/custom-post-title-class-based-on-category#post-17145</link>
<pubDate>Sat, 20 Nov 2010 06:21:33 +0000</pubDate>
<dc:creator>Vasudeva Adiga</dc:creator>
<guid isPermaLink="false">17145@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;You don't have to write php code to do this: each post has the category css class already like this:&#60;/p&#62;
&#60;p&#62;&#38;lt;div class=&#34;post-1 post type-post hentry category-blog category-uncategorized&#34; id=&#34;post-1&#34;&#38;gt;&#38;lt;h2 class=&#34;entry-title&#34;&#38;gt;&#60;a rel=&#34;bookmark&#34; title=&#34;Permalink to Hello world!&#34; href=&#34;http://localhost/wordpress/?p=1&#34;&#62;Hello world!&#60;/a&#62;&#38;lt;/h2&#38;gt;....&#60;/p&#62;
&#60;p&#62;Write CSS like this:&#60;/p&#62;
&#60;p&#62;div.category-uncategorized h2 {&#60;br /&#62;
  color: red;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;div.category-cat h2 {&#60;br /&#62;
  color: white;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;div.category-dog h2 {&#60;br /&#62;
  color: black;&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>
<item>
<title>almour on "Custom post title class Based on Category"</title>
<link>http://themeshaper.com/forums/topic/custom-post-title-class-based-on-category#post-17107</link>
<pubDate>Thu, 18 Nov 2010 19:21:35 +0000</pubDate>
<dc:creator>almour</dc:creator>
<guid isPermaLink="false">17107@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi, I would like to have custom post title styling for different categories in my child theme.&#60;/p&#62;
&#60;p&#62;For example: Post title on category a &#38;gt;&#38;gt; css: class .a&#60;br /&#62;
Post title on category b &#38;gt;&#38;gt; css: class .b &#60;/p&#62;
&#60;p&#62;In order to do that, I think I have to filter thematic_postheader_posttitle so it generates custom class, and then styling each class in CSS.&#60;/p&#62;
&#60;p&#62;My code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function ruby_postheader_posttitle($posttitle){
	if(in_category(&#38;#39;cat&#38;#39;)){
		$posttitle = &#38;#39;&#38;lt;h2 class=&#38;quot;catclass&#38;quot;&#38;gt;&#38;lt;a href=&#38;quot;&#38;#39;;
	    $posttitle .= apply_filters(&#38;#39;the_permalink&#38;#39;, get_permalink());
	    $posttitle .= &#38;#39;&#38;quot; title=&#38;quot;&#38;#39;;
	    $posttitle .= __(&#38;#39;Permalink to &#38;#39;, &#38;#39;thematic&#38;#39;) . the_title_attribute(&#38;#39;echo=0&#38;#39;);
	    $posttitle .= &#38;#39;&#38;quot; rel=&#38;quot;bookmark&#38;quot;&#38;gt;&#38;#39;;
	    $posttitle .= get_the_title();
	    $posttitle .= &#38;quot;&#38;lt;/a&#38;gt;&#38;lt;/h2&#38;gt;\n&#38;quot;;
		}
	else if(in_category (&#38;#39;dog&#38;#39;)){
		$posttitle = &#38;#39;&#38;lt;h2 class=&#38;quot;dogclass&#38;quot;&#38;gt;&#38;lt;a href=&#38;quot;&#38;#39;;
	    $posttitle .= apply_filters(&#38;#39;the_permalink&#38;#39;, get_permalink());
	    $posttitle .= &#38;#39;&#38;quot; title=&#38;quot;&#38;#39;;
	    $posttitle .= __(&#38;#39;Permalink to &#38;#39;, &#38;#39;thematic&#38;#39;) . the_title_attribute(&#38;#39;echo=0&#38;#39;);
	    $posttitle .= &#38;#39;&#38;quot; rel=&#38;quot;bookmark&#38;quot;&#38;gt;&#38;#39;;
	    $posttitle .= get_the_title();
	    $posttitle .= &#38;quot;&#38;lt;/a&#38;gt;&#38;lt;/h2&#38;gt;\n&#38;quot;;
		}
	else{
		return $posttitle;
		}
}?&#38;gt;
&#38;lt;?php add_filter(&#38;#39;thematic_postheader_posttitle&#38;#39;, &#38;#39;ruby_postheader_posttitle&#38;#39;);
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I ended up with no title in both categories :P. What am I doing wrong?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
