WordPress.org

Ready to get started?Download WordPress

Forums

Breadcrumbs relative to wp_nav_menu (2 posts)

  1. Streetproject
    Member
    Posted 3 years ago #

    I have a blog page that uses breadcrumbs. Currently they only go 3 levels deep, here is the bit of code:

    <?php
    						if($post->post_parent){
    							$new_parent = get_post($post->post_parent);
    							if($new_parent->post_parent){
    								echo '<a href="'.get_permalink($new_parent->post_parent).'">'.get_the_title($new_parent->post_parent).'</a> <span class="raquo">&raquo; </span>';
    							}
    							echo '<a href="'.get_permalink($post->post_parent).'">'.get_the_title($post->post_parent).'</a> <span class="raquo">&raquo;</span>';
    						}
    					?>
    					<?php wp_title(''); ?>

    The problem is that is specifically what the parents are of the pages, I want the parents relative to the menu I currently have. I have searched google and so far no good. Anyone have any ideas?

  2. Streetproject
    Member
    Posted 3 years ago #

    as an added note, here is what I have determined:

    I need to get the current navigation menu
    I need to match the current page id with the id on the navigation
    I need to check to see if that page (on the navigation) has any parents
    I need to print the name and a link to that parent

    What is bold is what I don't know how to do. Can anyone help? Any leads or anything will be greatly appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic