<?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>SydneyFX - A Web Designer Blog &#187; customising wordpress</title>
	<atom:link href="http://www.sydneyfx.com.au/wordpress/tag/customising-wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sydneyfx.com.au/wordpress</link>
	<description>Ramblings of a Freelance Web Designer &#38; Developer</description>
	<lastBuildDate>Mon, 19 Jul 2010 08:58:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to remove link from the_category in WordPress</title>
		<link>http://www.sydneyfx.com.au/wordpress/how-to-remove-link-from-the_category-in-wordpress/167</link>
		<comments>http://www.sydneyfx.com.au/wordpress/how-to-remove-link-from-the_category-in-wordpress/167#comments</comments>
		<pubDate>Mon, 21 Apr 2008 11:55:23 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Wordpress Customisation]]></category>
		<category><![CDATA[customising wordpress]]></category>
		<category><![CDATA[get_the_category]]></category>
		<category><![CDATA[the_category]]></category>

		<guid isPermaLink="false">http://www.sydneyfx.com.au/wordpress/?p=167</guid>
		<description><![CDATA[Recently I&#8217;ve been delving into customising both WordPress and Drupal and although I&#8217;d consider myself still a beginner, I still think it&#8217;s worth writing about problems I&#8217;ve encountered so others learning WordPress &#38; Drupal customisation, can do it without the &#8230; <a href="http://www.sydneyfx.com.au/wordpress/how-to-remove-link-from-the_category-in-wordpress/167">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sydneyfx.com.au/wordpress/wp-content/2008/04/wordpressicon-hanttula3.jpg"><img class="alignleft size-full wp-image-168" style="margin-left: 10px; margin-right: 10px; margin-top: 5px; margin-bottom: 5px; float: left;" title="wordpressicon-hanttula3" src="http://www.sydneyfx.com.au/wordpress/wp-content/2008/04/wordpressicon-hanttula3.jpg" alt="Powered by WordPress" width="193" height="80" /></a>Recently I&#8217;ve been delving into customising both WordPress and Drupal and although I&#8217;d consider myself still a beginner, I still think it&#8217;s worth writing about problems I&#8217;ve encountered so others learning WordPress &amp; Drupal  customisation, can do it without the same frustrations.</p>
<p>So today I&#8217;m going to talk about how I needed to include a post category on a post page.  A client required each post to have a header above the post with the posts category name nicely styled with CSS above the post. After a read though the WordPress documentation and some experimentation, I ended up with the  <a href="http://codex.wordpress.org/Template_Tags/the_category">the_category tag</a> and what I thought would be the solution to my problem.</p>
<p>Unfortunately, this wasn&#8217;t entirely correct as the_category tag causes the category name to be a link text as well which wasn&#8217;t what I wanted. So I dugg around the WordPress docs and forums to try to find how this could be done.  It wasn&#8217;t long before I found others looking for the same solution and responded to their own problem post with&#8230; <em>&#8216;it&#8217;s ok, I&#8217;ve worked it out&#8217;.</em> That&#8217;s right&#8230; they didn&#8217;t put how they solved the problem which is why I couldn&#8217;t resist writing about this. So here is the solution&#8230;</p>
<div class="threadpost col-7">
<div class="post">
<p>Instead of using the_category, you use <a href="http://codex.wordpress.org/Template_Tags/get_the_category">get_the_category</a> as follows</p>
<pre><code>&lt;?php
foreach((get_the_category()) as $category) {
echo $category-&gt;cat_name . ' ';
}
?&gt;</code></pre>
<p>get_the_category tag comes with other objects that are available from the array.</p>
<ol>
<li>cat_ID &#8211; <em>category id</em></li>
<li>cat_name &#8211; <em>category name</em></li>
<li>category_nicename -<em>post slug</em></li>
<li>category_description &#8211; <em>category description</em></li>
<li>category_parent &#8211; <em>the current categories parent category id</em></li>
<li>category_count &#8211; <em>the number of uses of this category</em></li>
</ol>
<p>You can find more information at the url below.</p>
<p><a rel="nofollow" href="http://codex.wordpress.org/Template_Tags/get_the_category">http://codex.wordpress.org/Template_Tags/get_the_category</a></p>
</div>
<div class="post">Whilst looking back in hind sight, this seem pretty obvious&#8230; when your trawling through documents, blog posts, forums, you find yourself missing the critical piece of the puzzle. Hope this helps&#8230;:-)
</div>
</div>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sydneyfx.com.au%2Fwordpress%2Fhow-to-remove-link-from-the_category-in-wordpress%2F167&amp;title=How+to+remove+link+from+the_category+in+WordPress" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.sydneyfx.com.au/wordpress/how-to-remove-link-from-the_category-in-wordpress/167/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

