Title: Breadcrumb and formatting issues
Last modified: August 21, 2016

---

# Breadcrumb and formatting issues

 *  [derbra1513](https://wordpress.org/support/users/derbra1513/)
 * (@derbra1513)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/breadcrumb-and-formatting-issues/)
 * I have a website that is being organized using posts and pages, the pages are
   used for product pages and categories and sub categories and the posts are used
   for the individual products.
 * You can take a look at the structure below using the links. The problem I am 
   having is using the breadcrumbs code, since it uses $post->parent. So the code
   works great for the hierarchy until you click on the individual products, which
   takes you to the “posts” section of the website. I hope I’ve explained myself
   correctly and really appreciate the help.
 * [http://dwmultimediadesign.com/hosting/wordpress2/ingredients/av/av-pw/av-pw-par/](http://dwmultimediadesign.com/hosting/wordpress2/ingredients/av/av-pw/av-pw-par/)
 *     ```
       <?php
       	            $parent_id  = $post->post_parent;
       	            $breadcrumbs = array();
       	            while ($parent_id) {
       	              $page = get_page($parent_id);
       	              $breadcrumbs[] = '<a href="'.get_permalink($page->ID).'" title="">'.get_the_title($page->ID).'</a>';
       	              $parent_id  = $page->post_parent;
       	            }
       	            $breadcrumbs = array_reverse($breadcrumbs);
       	            foreach ($breadcrumbs as $crumb) echo "$crumb";
       	          ?>
       ```
   

The topic ‘Breadcrumb and formatting issues’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [derbra1513](https://wordpress.org/support/users/derbra1513/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/breadcrumb-and-formatting-issues/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
