<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1-alpha-2539" -->
<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>WordPress.com Forums &#187; Topic: Body class all categories listed</title>
		<link>http://en.forums.wordpress.com/topic/body-class-all-categories-listed</link>
		<description>WordPress.com Forums &#187; Topic: Body class all categories listed</description>
		<language>en</language>
		<pubDate>Wed, 22 May 2013 01:59:46 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1-alpha-2539</generator>
				<atom:link href="http://en.forums.wordpress.com/rss/topic/body-class-all-categories-listed" rel="self" type="application/rss+xml" />

		<item>
			<title>supportbot on "Body class all categories listed"</title>
			<link>http://en.forums.wordpress.com/topic/body-class-all-categories-listed#post-1163463</link>
			<pubDate>Tue, 26 Feb 2013 01:11:31 +0000</pubDate>
			<dc:creator>supportbot</dc:creator>
			<guid isPermaLink="false">1163463@http://en.forums.wordpress.com/</guid>
			<description><![CDATA[<p>The blog you specified at test.keystagehistory.co.uk does not appear to be hosted at WordPress.com.</p>
<p>This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you'll find help at the <a href="http://wordpress.org/support/">WordPress.org forums</a>.</p>
<p>If you don't understand the difference between WordPress.com and WordPress.org, you may find <a href="http://support.wordpress.com/com-vs-org/">this information</a> helpful.</p>
<p>If you forgot to include a link to your blog, you can reply and include it below.  It'll help people to answer your question.</p>
<p>This is an automated message.
</p>
]]></description>
					</item>
		<item>
			<title>njthomp on "Body class all categories listed"</title>
			<link>http://en.forums.wordpress.com/topic/body-class-all-categories-listed#post-1163462</link>
			<pubDate>Tue, 26 Feb 2013 01:11:30 +0000</pubDate>
			<dc:creator>njthomp</dc:creator>
			<guid isPermaLink="false">1163462@http://en.forums.wordpress.com/</guid>
			<description><![CDATA[<p>hi,<br />
  i have an issue and have looked high and low for the answer but to no avail.  i have many wordpress sites and love wordpress but on this occassion i am stumped.</p>
<p>basically i have a site with many child categories of parent categories</p>
<p>i.e. category 1 --&#62; category 1.1<br />
                                 category 1.2<br />
etc</p>
<p>i want all the child categories, post pages etc to have the same parent categories sytle. i.e i everything that is in category 1 to have exactly the  same backgound header etc.</p>
<p>i managed this for post and pages by using the following in functons.php:</p>
<p>}<br />
add_filter('body_class','add_category_to_single');<br />
function add_category_to_single($classes, $class) {<br />
	if (is_single() ) {<br />
		global $post;<br />
		foreach((get_the_category($post-&#62;ID)) as $category) {<br />
			echo $category-&#62;cat_name . ' ';<br />
			// add category slug to the $classes array<br />
			$classes[] = 'category-'.$category-&#62;slug;<br />
		}<br />
	}<br />
	// return the $classes array<br />
	return $classes;<br />
}</p>
<p>this was great.  for each post it showed every category that the body was in, incluuding for example 'category-1' which i could then style using CSS.</p>
<p>however this was obviously not applicable for my child categories and they do not show in body class the parent category that i have assigned them.</p>
<p>i would be very grateful if someone could help me to get a potential conditional format via functions.php so that  for example category 1--&#62; <strong>category 1.1</strong> will show in body class it's parent category so it can be styled by my parent cateorgy css.<br />
many thanks in advance for any help. i really have spent hours searching this and to no avail for categories so it is not for the want of trying or an easy way out to ask, i am just stumped!!!!</p>
<p>many thanks</p>
<p>Nick
</p>
]]></description>
					</item>

	</channel>
</rss>
