<?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: How to get parent category in breadcrumbs on the single product page?</title>
		<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page</link>
		<description>Support Forum - Topic: How to get parent category in breadcrumbs on the single product page?</description>
		<language>en-US</language>
		<pubDate>Tue, 18 Jun 2013 20:42:39 +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/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page" rel="self" type="application/rss+xml" />

		<item>
			<title>Dude on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-74288</link>
			<pubDate>Tue, 04 Sep 2012 10:16:48 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">74288@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi! &#60;/p&#62;
&#60;p&#62; I improved the breadcrumb code a bit. It's more versatile now. &#60;/p&#62;
&#60;p&#62; Best regards,&#60;br /&#62;
Peter
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aijinse on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-74071</link>
			<pubDate>Sun, 02 Sep 2012 12:17:15 +0000</pubDate>
			<dc:creator>aijinse</dc:creator>
			<guid isPermaLink="false">74071@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi, Peter&#60;/p&#62;
&#60;p&#62;That's work correctly!!&#60;br /&#62;
Thank you very much your support!:)&#60;/p&#62;
&#60;p&#62;Best Regards,&#60;/p&#62;
&#60;p&#62;Jin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dude on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-74066</link>
			<pubDate>Sun, 02 Sep 2012 10:11:43 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">74066@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hey! &#60;/p&#62;
&#60;p&#62; I updated the code. &#60;/p&#62;
&#60;p&#62; Regards,&#60;br /&#62;
Peter
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dude on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-73412</link>
			<pubDate>Wed, 29 Aug 2012 05:22:56 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">73412@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Try following code instead:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$prod_cat = array();
			$id = (int) get_the_ID();
			$taxonomy = &#38;#39;product_cat&#38;#39;;

			if ( !empty($id) &#38;amp;&#38;amp; !empty($taxonomy) )
			{
				$args = array(&#38;#39;orderby&#38;#39; =&#38;gt; &#38;#39;term_id&#38;#39;, &#38;#39;order&#38;#39; =&#38;gt; &#38;#39;ASC&#38;#39;, &#38;#39;fields&#38;#39; =&#38;gt; &#38;#39;all&#38;#39;);

				$prod_cat = wp_get_object_terms( $id, $taxonomy, $args );
				wp_cache_add($id, $prod_cat, $taxonomy . &#38;#39;_relationships&#38;#39;);
				$prod_cat = apply_filters( &#38;#39;get_the_terms&#38;#39;, $prod_cat, $id, $taxonomy );
			}

			if (!empty($prod_cat))
			{
				$trail_array = &#38;#39;&#38;#39;;
				$parent_cats = array();

				foreach ($prod_cat as $cat) {
					if(!empty($cat-&#38;gt;parent))
					{
						if (!in_array($cat-&#38;gt;parent, $parent_cats, false)) $parent_cats[] = (int) $cat-&#38;gt;parent;
					}
					else
					{
						if (!in_array(0, $parent_cats, false)) $parent_cats[] = (int) 0;
					}
				}

				$i = 0;
				foreach ($parent_cats as $parent_cat) {
					foreach ($prod_cat as $cat) {
						if ( !empty($cat-&#38;gt;name) &#38;amp;&#38;amp; isset($cat-&#38;gt;parent) &#38;amp;&#38;amp; $cat-&#38;gt;parent == $parent_cat )
						{
							if ( $i == 0 )
							{
								$trail_array .= &#38;#39;&#38;lt;a href=&#38;quot;&#38;#39;. get_term_link( $cat-&#38;gt;slug, $taxonomy ) .&#38;#39;&#38;quot;&#38;gt;&#38;#39; . $cat-&#38;gt;name . &#38;#39;&#38;lt;/a&#38;gt;,&#38;#39;;
							}
							else
							{
								$trail_array .= &#38;#39; &#38;lt;span class=&#38;quot;sep&#38;quot;&#38;gt;&#38;#39; . $separator . &#38;#39;&#38;lt;/span&#38;gt; &#38;#39; . &#38;#39;&#38;lt;a href=&#38;quot;&#38;#39;. get_term_link( $cat-&#38;gt;slug, $taxonomy ) .&#38;#39;&#38;quot;&#38;gt;&#38;#39; . $cat-&#38;gt;name . &#38;#39;&#38;lt;/a&#38;gt;,&#38;#39;;
							}
						}
					}
					$trail_array = (substr($trail_array,-1) == &#38;#39;,&#38;#39;) ? substr($trail_array, 0, -1) : $trail_array;
					$i++;
				}
				$trail[] = $trail_array;
			}
		}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Devin on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-73292</link>
			<pubDate>Tue, 28 Aug 2012 18:36:23 +0000</pubDate>
			<dc:creator>Devin</dc:creator>
			<guid isPermaLink="false">73292@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Jin,&#60;/p&#62;
&#60;p&#62;I've asked Peter to take a look at your code above to see if there is any additional help he can provide.&#60;/p&#62;
&#60;p&#62;Regards,&#60;/p&#62;
&#60;p&#62;Devin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aijinse on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-72836</link>
			<pubDate>Sat, 25 Aug 2012 12:14:53 +0000</pubDate>
			<dc:creator>aijinse</dc:creator>
			<guid isPermaLink="false">72836@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi,Dude&#60;/p&#62;
&#60;p&#62;Thanks the above link.&#60;/p&#62;
&#60;p&#62;I've tried the below code:&#60;br /&#62;
---&#60;br /&#62;
$prod_cat = array();&#60;br /&#62;
$prod_cat[] = get_the_term_list(get_the_ID(), 'product_cat','',';','','');&#60;br /&#62;
$cat_array = explode(&#34;;&#34;, $prod_cat[0]);&#60;/p&#62;
&#60;p&#62;$parent = $cat_array[count($cat_array) - 1];&#60;br /&#62;
if(count($cat_array) &#38;gt;= 2) {&#60;br /&#62;
	$child = $cat_array[count($cat_array) - 2];&#60;br /&#62;
} else {&#60;br /&#62;
	$child = $cat_array[0];&#60;br /&#62;
}&#60;br /&#62;
if(count($cat_array) &#38;gt; 0 ) {&#60;br /&#62;
	if($parent == $child) {&#60;br /&#62;
		$trail_array = $parent;&#60;br /&#62;
	} else {&#60;br /&#62;
		$trail_array = $parent . ' &#38;lt;span class=&#34;sep&#34;&#38;gt;' . $separator . '&#38;lt;/span&#38;gt; ' . $child;&#60;br /&#62;
	}&#60;br /&#62;
	$trail[] = $trail_array;&#60;br /&#62;
}&#60;br /&#62;
---&#60;/p&#62;
&#60;p&#62;Do not work correctly It looks like there is no problem.&#60;br /&#62;
Parent and child are displayed order is reversed.&#60;/p&#62;
&#60;p&#62;Product Category↓&#60;br /&#62;
---&#60;br /&#62;
Bottom&#60;br /&#62;
 - Skirt&#60;br /&#62;
  - Skirt01&#60;br /&#62;
---&#60;/p&#62;
&#60;p&#62;Displayed↓&#60;br /&#62;
---&#60;br /&#62;
Skirt &#38;gt;&#38;gt; Bottom &#38;gt;&#38;gt; Skirt01&#60;br /&#62;
---&#60;/p&#62;
&#60;p&#62;Is there any other way?&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Jin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dude on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-72619</link>
			<pubDate>Fri, 24 Aug 2012 06:19:29 +0000</pubDate>
			<dc:creator>Dude</dc:creator>
			<guid isPermaLink="false">72619@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hey! &#60;/p&#62;
&#60;p&#62; Have a look at this thread: &#60;a href=&#34;http://www.kriesi.at/support/topic/breadcrumbs-glitching-illogical-structure&#34; rel=&#34;nofollow&#34;&#62;http://www.kriesi.at/support/topic/breadcrumbs-glitching-illogical-structure&#60;/a&#62; &#60;/p&#62;
&#60;p&#62; Best regards,&#60;br /&#62;
Peter
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aijinse on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-72521</link>
			<pubDate>Thu, 23 Aug 2012 15:21:26 +0000</pubDate>
			<dc:creator>aijinse</dc:creator>
			<guid isPermaLink="false">72521@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi, Devin&#60;/p&#62;
&#60;p&#62;Thanks for your reply.&#60;br /&#62;
I'm waiting for the result.&#60;/p&#62;
&#60;p&#62;Regards,&#60;/p&#62;
&#60;p&#62;Jin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Devin on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-72347</link>
			<pubDate>Wed, 22 Aug 2012 17:24:59 +0000</pubDate>
			<dc:creator>Devin</dc:creator>
			<guid isPermaLink="false">72347@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hi Jin,&#60;/p&#62;
&#60;p&#62;I'm not sure if this is doable or not as it uses the avia_breadcrumbs() function and I'm not sure if it can support checking parent products in that way.&#60;/p&#62;
&#60;p&#62;I've tagged the topic for another of the support crew who should be able to give a definitive yes or no and assist with that.&#60;/p&#62;
&#60;p&#62;Regards,&#60;/p&#62;
&#60;p&#62;Devin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aijinse on "How to get parent category in breadcrumbs on the single product page?"</title>
			<link>http://www.kriesi.at/support/topic/how-to-get-parent-category-in-breadcrumbs-on-the-single-product-page#post-71878</link>
			<pubDate>Mon, 20 Aug 2012 12:05:56 +0000</pubDate>
			<dc:creator>aijinse</dc:creator>
			<guid isPermaLink="false">71878@http://www.kriesi.at/support/</guid>
			<description>&#60;p&#62;Hello Kriesi team,&#60;/p&#62;
&#60;p&#62;I would like to display a link to the product parent category on the single product page.&#60;/p&#62;
&#60;p&#62;For example:&#60;br /&#62;
---------------------------&#60;br /&#62;
Bottom (parent product category)&#60;br /&#62;
- Skirt (child product category)&#60;br /&#62;
 - Skirt01 (a single product page)&#60;br /&#62;
---------------------------&#60;/p&#62;
&#60;p&#62;When being on the Skirt01 page,&#60;br /&#62;
Right now the breadcrumb looks like this:&#60;/p&#62;
&#60;p&#62;Home ≫ Products ≫ Bottom ≫ Skirt ≫ Skirt01&#60;/p&#62;
&#60;p&#62;How can I do this?&#60;/p&#62;
&#60;p&#62;Thank you very much.&#60;/p&#62;
&#60;p&#62;Jin
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
