added breadcrumbs to product page
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 22 Dec 2015 17:43:45 +0000 (12:43 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 22 Dec 2015 17:43:45 +0000 (12:43 -0500)
index.php
views/product_detail.php

index b2fa397..b3a3e51 100644 (file)
--- a/index.php
+++ b/index.php
@@ -375,7 +375,6 @@ function michsci_get_terms_dropdown()
     $taxonomyName = MICHSCI_CATEGORY_NAME;
     $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'name', 'hide_empty' => false));
     $output ="<select id='categoryDropdown' name=\"" . MICHSCI_CATEGORY_NAME . "\"><option value=\"\">Select " . MICHSCI_CATEGORY_SINGLE . "</option>";
-
         // get parent categories
         foreach ($parent_terms as $parent){
 
index f838fa3..7585d12 100644 (file)
@@ -1,6 +1,16 @@
+<?php
+$array = get_post_ancestors($product->ID);
+$relatives = array_reverse($array);
+    ?>
+<?php foreach($relatives as $relative){
+    $relative_post = get_post($relative);
+    echo '<a href="#">' . $relative_post->post_name . '</a>' . " > " ;
+} ?>
+<?php echo $product->post_title; ?>
 <h2><?php echo $product->post_title; ?></h2>
     <?php
     setup_postdata( $product );
     the_content();
+    
 ?>