Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For example, suppose a menu like so:

Parent 1
  Child A
  Child B
Parent 1
  Child C
  Child D
  Child E
Parent 2
  Child F

In a certain part of my template, I want something to show depending on the current "location" in the menu. If the user is on the Parent 1, Child C, Child D, or Child E pages, then I want a little menu to show up that says Parent 1 as the header and the children as the links. I've tried a variety of things (creating a custom walker object, writing css to just not show the items that shouldn't show, etc.) Also, if there are no children at all, then I don't want to display the parent even on the parent's own page. Does this make sense?

I don't want a plugin that does/helps with this (I don't like to have my template "depend" on a plugin)

share|improve this question

1 Answer 1

I agree I also don't like plugins. What I would do is take the dimox_breadcrumbs function (basically a breadcrumb navigation without a lot of code) and then modify the code a little and add it to your menu using PHP

Go to http://dimox.net/wordpress-breadcrumbs-without-a-plugin/

Because it's not a plugin it's very easy to modify even for laymen and I found it to be the most reliable code out there for things like that

share|improve this answer
1  
can you explain how this answers the question and how the code works? If dimox cant pay his hosting bills or looses his data this answer becomes useless –  Tom J Nowell Apr 7 at 22:51
    
Future-proofing. Good suggestion. –  jdm2112 Jul 18 at 4:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.