<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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>Support Forum - Topic: PHP variable for post link?</title>
		<link>http://www.kriesi.at/support/topic/php-variable-for-post-link</link>
		<description>Support Forum - Topic: PHP variable for post link?</description>
		<language>en-US</language>
		<pubDate>Thu, 20 Jun 2013 04:59:00 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.kriesi.at/support/search.php</link>
		</textInput>
		<atom:link href="http://www.kriesi.at/support/rss/topic/php-variable-for-post-link" rel="self" type="application/rss+xml" />

		<item>
			<title>James Morrison on "PHP variable for post link?"</title>
			<link>http://www.kriesi.at/support/topic/php-variable-for-post-link#post-1611</link>
			<pubDate>Sun, 01 Aug 2010 12:53:09 +0000</pubDate>
			<dc:creator>James Morrison</dc:creator>
			<guid isPermaLink="false">1611@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Can you clarify exactly what you're trying to do?&#60;/p&#62;
&#60;p&#62;From your description in the 1st post, you want to add a link - by the looks of the copypastecode.com code, you're trying to add a link for each category.&#60;/p&#62;
&#60;p&#62;Either way, this code should get you started:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//get all blog categories regardless of whether on this post or not
	$categories = get_categories(&#38;#39;title_li=&#38;amp;orderby=name&#38;amp;hide_empty=0&#38;#39;);

	//get the categories which are attached to this post
	$categories = get_the_category();

	if ($categories) {

		foreach($categories as $category) {
			$output .= &#38;quot;&#38;lt;a href=&#38;#39;&#38;quot;.get_bloginfo(&#38;#39;home&#38;#39;).&#38;quot;/forum/&#38;quot;.$category-&#38;gt;category_nicename.&#38;quot;/&#38;#39; id=&#38;#39;&#38;quot;.$category-&#38;gt;category_nicename.&#38;quot;&#38;#39;&#38;gt;&#38;quot;.$category-&#38;gt;cat_name.&#38;quot;&#38;lt;/a&#38;gt;&#38;quot;;
		}

	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;strong&#62;Important Note&#60;/strong&#62;: You must delete or comment out one of the $categories declarations depending on your intentions for this code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sunkapoor on "PHP variable for post link?"</title>
			<link>http://www.kriesi.at/support/topic/php-variable-for-post-link#post-1319</link>
			<pubDate>Thu, 29 Jul 2010 07:23:05 +0000</pubDate>
			<dc:creator>sunkapoor</dc:creator>
			<guid isPermaLink="false">1319@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;That didn't come out right, please see the code that I have so far here:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.copypastecode.com/33316&#34; rel=&#34;nofollow&#34;&#62;http://www.copypastecode.com/33316&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sunkapoor on "PHP variable for post link?"</title>
			<link>http://www.kriesi.at/support/topic/php-variable-for-post-link#post-1302</link>
			<pubDate>Thu, 29 Jul 2010 02:37:14 +0000</pubDate>
			<dc:creator>sunkapoor</dc:creator>
			<guid isPermaLink="false">1302@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;and this is where I'm stuck: &#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
foreach((get_the_category()) as $category) {&#60;br /&#62;
    echo '&#60;a&#62;category_nicename . '/&#34; alt=&#34;' . $category-&#38;gt;cat_name . '&#34; /&#38;gt;';&#60;br /&#62;
}&#60;br /&#62;
?&#38;gt;Forum&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Not sure how to add the URL slug after the category name.&#60;/p&#62;
&#60;p&#62;Please advise.&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sunkapoor on "PHP variable for post link?"</title>
			<link>http://www.kriesi.at/support/topic/php-variable-for-post-link#post-1299</link>
			<pubDate>Thu, 29 Jul 2010 00:42:30 +0000</pubDate>
			<dc:creator>sunkapoor</dc:creator>
			<guid isPermaLink="false">1299@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;I am wanting to include a php code which will produce a link above each post. Code link will be something like this:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://xxx.com/xxx/category/slug&#34; rel=&#34;nofollow&#34;&#62;http://xxx.com/xxx/category/slug&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Can the support staff, please provide a PHP code, where the above link can be accomplished and place in the theme file (I know where to place it). I would need the category name and slug pulled from the post. It should work with my permalinks settings.&#60;/p&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
