<?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"
	>
<channel>
	<title>Comments on: A custom header for one category</title>
	<atom:link href="http://www.bioneural.net/2006/06/04/a-custom-header-for-one-category/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-&amp;seed_title=A+custom+header+for+one+category</link>
	<description>bioneural.net is for stuff worth sharing: commentary by Bruce McKenzie. Major topics covered are gadgets, informatics, Internet, Mac, mobile, musings, New Zealand, photography, Project Koru, quicklinks, rant, rave, travel and Windows</description>
	<pubDate>Sat, 26 Jul 2008 02:52:37 +0000</pubDate>
	
		<item>
		<title>By: stewar</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-75695&amp;seed_title=A+custom+header+for+one+category#comment-75695</link>
		<dc:creator>stewar</dc:creator>
		<pubDate>Mon, 30 Jul 2007 06:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-75695</guid>
		<description>&lt;p&gt;Hey thanks for the tip. I'm doing some pretty heavy category-based theming by using in_category within header.php to vary CSS style selectors that get output... but i couldn't work out why the supposedly default case wasn't being applied to the 404 page - something to do with being outside The Loop at that point i suspect - anyway your little bit of logic killed the 'bug' for me so thanks. (and thanks google for bringing me here :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey thanks for the tip. I'm doing some pretty heavy category-based theming by using in_category within header.php to vary CSS style selectors that get output... but i couldn't work out why the supposedly default case wasn't being applied to the 404 page - something to do with being outside The Loop at that point i suspect - anyway your little bit of logic killed the 'bug' for me so thanks. (and thanks google for bringing me here :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1683&amp;seed_title=A+custom+header+for+one+category#comment-1683</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Sun, 25 Jun 2006 14:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1683</guid>
		<description>Jez, yes, it is working. But you understand it's not a randomizer? It changes the header image for one category only. In my case, for &lt;a href="http://www.bioneural.net/category/project-koru/" rel="nofollow"&gt;this&lt;/a&gt; category. I use K2; I haven't tested it with a non-K2 WordPress installation. Remember you need to set the category to &lt;strong&gt;your&lt;/strong&gt; ID, not mine (which is the 15 in the example here).</description>
		<content:encoded><![CDATA[<p>Jez, yes, it is working. But you understand it's not a randomizer? It changes the header image for one category only. In my case, for <a href="http://www.bioneural.net/category/project-koru/" rel="nofollow">this</a> category. I use K2; I haven't tested it with a non-K2 WordPress installation. Remember you need to set the category to <strong>your</strong> ID, not mine (which is the 15 in the example here).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jez</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1682&amp;seed_title=A+custom+header+for+one+category#comment-1682</link>
		<dc:creator>jez</dc:creator>
		<pubDate>Sun, 25 Jun 2006 14:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1682</guid>
		<description>hi there,
i really like the idea of changing the header, unluckyly i couldn't get it to work yet.
have you?
because by clicking through your site, I didnt notice a changing header so far.

regards,
jez</description>
		<content:encoded><![CDATA[<p>hi there,<br />
i really like the idea of changing the header, unluckyly i couldn't get it to work yet.<br />
have you?<br />
because by clicking through your site, I didnt notice a changing header so far.</p>
<p>regards,<br />
jez</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1387&amp;seed_title=A+custom+header+for+one+category#comment-1387</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Tue, 13 Jun 2006 21:09:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1387</guid>
		<description>Olav, a warm welcome to the Norwegian navy! I agree this is a useful facility, particularly if you want "site within a site" treatment for a single category. A unique header for a given category (e.g. Mac images for "Mac") should send a strong visual cue to readers regarding the page subject. However, I see two problems (there may be more!) if this is done for every category:

&lt;ol&gt;
&lt;li&gt;Because visitors won't cache a re-usable header image as they browse, page load times will increase each time they browse a post in a new category.&lt;/li&gt;
&lt;li&gt;The "branding" value of a static header may be lost. I think the distinctiveness of the header is the main way I personally recognise/ recall a site as a returning visitor.&lt;/li&gt;
&lt;/ol&gt;

There may be a compromise. At this point the best one I can think of is this:

&lt;ol&gt;
&lt;li&gt;A smallish distinctive header/ site logo that appears on all pages.&lt;/li&gt;
&lt;li&gt;Use the CSS "z-index" property and positioning to layer a transparent category-specific .png on top of (or overlapping) the static header image.&lt;/li&gt;
&lt;/ol&gt;

Would this not achieve the required balance?</description>
		<content:encoded><![CDATA[<p>Olav, a warm welcome to the Norwegian navy! I agree this is a useful facility, particularly if you want "site within a site" treatment for a single category. A unique header for a given category (e.g. Mac images for "Mac") should send a strong visual cue to readers regarding the page subject. However, I see two problems (there may be more!) if this is done for every category:</p>
<ol>
<li>Because visitors won't cache a re-usable header image as they browse, page load times will increase each time they browse a post in a new category.</li>
<li>The "branding" value of a static header may be lost. I think the distinctiveness of the header is the main way I personally recognise/ recall a site as a returning visitor.</li>
</ol>
<p>There may be a compromise. At this point the best one I can think of is this:</p>
<ol>
<li>A smallish distinctive header/ site logo that appears on all pages.</li>
<li>Use the CSS "z-index" property and positioning to layer a transparent category-specific .png on top of (or overlapping) the static header image.</li>
</ol>
<p>Would this not achieve the required balance?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olav</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1378&amp;seed_title=A+custom+header+for+one+category#comment-1378</link>
		<dc:creator>Olav</dc:creator>
		<pubDate>Tue, 13 Jun 2006 17:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1378</guid>
		<description>Good stuff, and I really like the idea of chaning your site for each category. Thanks!</description>
		<content:encoded><![CDATA[<p>Good stuff, and I really like the idea of chaning your site for each category. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleister</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1194&amp;seed_title=A+custom+header+for+one+category#comment-1194</link>
		<dc:creator>Aleister</dc:creator>
		<pubDate>Thu, 08 Jun 2006 00:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1194</guid>
		<description>Interesting. Well, I just looked again and noticed a clarification in the WP &lt;a href="http://codex.wordpress.org/Template_Tags/in_category#Use_OUTSIDE_The_Loop" rel="nofollow"&gt;documentation&lt;/a&gt;.

I have not ever tried using the category.php method, but that sounds like it would work nicely as well :)</description>
		<content:encoded><![CDATA[<p>Interesting. Well, I just looked again and noticed a clarification in the WP <a href="http://codex.wordpress.org/Template_Tags/in_category#Use_OUTSIDE_The_Loop" rel="nofollow">documentation</a>.</p>
<p>I have not ever tried using the category.php method, but that sounds like it would work nicely as well :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1189&amp;seed_title=A+custom+header+for+one+category#comment-1189</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 07 Jun 2006 16:13:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1189</guid>
		<description>Aleister, thanks. Use in_category &lt;em&gt;within the loop&lt;/em&gt; you say? OK, I have in_category within header.php, which is called in index.php &lt;em&gt;before&lt;/em&gt; theloop.php. I don't understand why my above trick works&#8212;unless it has something to do with the unique file structure of the K2 template...?

You're right that to create a "site within a site" I would want just the single post pages and category pages to have a unique look&#8212;as I have above. So presumably what ever alternative method worked to include (say) header-default.php &lt;em&gt;or&lt;/em&gt; header-koru.php would also work for two versions of archive.php which lists posts within category X (not to be confused with archives.php which lists posts by month and subject!)

The &lt;a href="http://codex.wordpress.org/Stepping_Into_Templates" rel="nofollow"&gt;Codex&lt;/a&gt; says:

&lt;blockquote&gt;You might want to have different information or looks to specific category listings of posts. WordPress automatically looks for the category.php template file to generate the list of category posts, and if it isn't found, then generates them using the index.php. Using the template hierarchy, if it finds the category.php template file, it then looks for a category template file that matches the category ID number being sought, for example, category-2.php. If that template file matches, it will use that template file to generate a page view of all the posts in category 2.&lt;/blockquote&gt;

I don't have a category.php file&#8212;but maybe if I made one (i.e. category-15.php) and used include to load the correct header, footer, etc?</description>
		<content:encoded><![CDATA[<p>Aleister, thanks. Use in_category <em>within the loop</em> you say? OK, I have in_category within header.php, which is called in index.php <em>before</em> theloop.php. I don't understand why my above trick works&mdash;unless it has something to do with the unique file structure of the K2 template...?</p>
<p>You're right that to create a "site within a site" I would want just the single post pages and category pages to have a unique look&mdash;as I have above. So presumably what ever alternative method worked to include (say) header-default.php <em>or</em> header-koru.php would also work for two versions of archive.php which lists posts within category X (not to be confused with archives.php which lists posts by month and subject!)</p>
<p>The <a href="http://codex.wordpress.org/Stepping_Into_Templates" rel="nofollow">Codex</a> says:</p>
<blockquote cite="http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1189&amp;seed_title=A+custom+header+for+one+category#comment-"><p>You might want to have different information or looks to specific category listings of posts. WordPress automatically looks for the category.php template file to generate the list of category posts, and if it isn't found, then generates them using the index.php. Using the template hierarchy, if it finds the category.php template file, it then looks for a category template file that matches the category ID number being sought, for example, category-2.php. If that template file matches, it will use that template file to generate a page view of all the posts in category 2.</p>
</blockquote>
<p>I don't have a category.php file&mdash;but maybe if I made one (i.e. category-15.php) and used include to load the correct header, footer, etc?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleister</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1188&amp;seed_title=A+custom+header+for+one+category#comment-1188</link>
		<dc:creator>Aleister</dc:creator>
		<pubDate>Wed, 07 Jun 2006 15:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1188</guid>
		<description>Actually the in_category function has to be used within the loop, so that particular method will not work. WordPress will not know what category is being viewing until a post is loaded in the loop.

Now if you wanted, you could insert the loop start code above everything else (not anything that outputs.. just the start of the while loop).

Then you would be able to use in_category to determine what header to show.

The main downside to that method is that you would only be able to use it in single.php for the actual post page, since it will only have one pass in the loop. If you did this to an archives page, it would go through the loop several times, trying to load the header, etc.. each time since it is after the start of the loop, and that would not work well at all.

Now if you want to have the custom header for category pages as well, one method would be to grab the category name from the URL. :)

I will be thinking about this, just in case there is a better option, but that would get it working for the cat listing pages as well as the single posts pages, which is all it would really need to be implemented for anyway, since archives pages etc.. will have posts from different categories together.</description>
		<content:encoded><![CDATA[<p>Actually the in_category function has to be used within the loop, so that particular method will not work. WordPress will not know what category is being viewing until a post is loaded in the loop.</p>
<p>Now if you wanted, you could insert the loop start code above everything else (not anything that outputs.. just the start of the while loop).</p>
<p>Then you would be able to use in_category to determine what header to show.</p>
<p>The main downside to that method is that you would only be able to use it in single.php for the actual post page, since it will only have one pass in the loop. If you did this to an archives page, it would go through the loop several times, trying to load the header, etc.. each time since it is after the start of the loop, and that would not work well at all.</p>
<p>Now if you want to have the custom header for category pages as well, one method would be to grab the category name from the URL. :)</p>
<p>I will be thinking about this, just in case there is a better option, but that would get it working for the cat listing pages as well as the single posts pages, which is all it would really need to be implemented for anyway, since archives pages etc.. will have posts from different categories together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1186&amp;seed_title=A+custom+header+for+one+category#comment-1186</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 07 Jun 2006 07:06:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1186</guid>
		<description>Now that's teasing Aleister! The Master wishes the Student to work it out himself, huh? ;-)

OK... do you think this would work for index.php?:

&#60;?php if ( in_category(15) ) { ?&#62;
&#60;?php include (TEMPLATEPATH . '/header-koru.php'); ?&#62;
&#60;?php } else { ?&#62;
&#60;?php include (TEMPLATEPATH . '/header-default.php'); ?&#62;
&#60;?php } ?&#62;
&#60;div class="content"&#62;
&#60;div class="primary"&#62;
&#60;?php include (TEMPLATEPATH . '/theloop.php'); ?&#62;
&#60;/div&#62;
&#60;?php get_sidebar(); ?&#62;
&#60;/div&#62;
&#60;?php get_footer(); ?&#62;</description>
		<content:encoded><![CDATA[<p>Now that's teasing Aleister! The Master wishes the Student to work it out himself, huh? ;-)</p>
<p>OK... do you think this would work for index.php?:</p>
<p>&lt;?php if ( in_category(15) ) { ?&gt;<br />
&lt;?php include (TEMPLATEPATH . '/header-koru.php'); ?&gt;<br />
&lt;?php } else { ?&gt;<br />
&lt;?php include (TEMPLATEPATH . '/header-default.php'); ?&gt;<br />
&lt;?php } ?&gt;<br />
&lt;div class="content"&gt;<br />
&lt;div class="primary"&gt;<br />
&lt;?php include (TEMPLATEPATH . '/theloop.php'); ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php get_sidebar(); ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php get_footer(); ?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleister</title>
		<link>http://www.bioneural.net/feeder/?FeederAction=clicked&amp;feed=Comments+on+Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fwww.bioneural.net%2F2006%2F06%2F04%2Fa-custom-header-for-one-category%2F%23comment-1184&amp;seed_title=A+custom+header+for+one+category#comment-1184</link>
		<dc:creator>Aleister</dc:creator>
		<pubDate>Wed, 07 Jun 2006 02:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.bioneural.net/2006/06/04/a-custom-header-for-a-one-category/#comment-1184</guid>
		<description>It is definitly possible :)</description>
		<content:encoded><![CDATA[<p>It is definitly possible :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
