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.

I have one custom menu in theme. You can see Buying menu have child archive page. i.e Active Listing. So what I want to do is at the top of the archive page for buying I want to display menu label.

Suppose I am on a page I want to show "Active Listing" at the top of archive list.

share|improve this question
add comment

closed as unclear what you're asking by toscho Jan 14 at 16:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

Add the following empty div where you want to display current menu label

<div class="menu-label-container"></div>  

and add the following script in footer of the page.

jQuery(document).ready(function(){
    if(jQuery('#nav li.current-menu-item  a').html())
        jQuery('.menu-label-container').html(jQuery('#nav li.current-menu-item  a').html());       
});

Tell me whether this solution is working for you or i will find another solution.

share|improve this answer
    
I want to do it with wordpress functions or php code, not with jQuery, BTW thanks –  Ajay Patel Mar 13 '13 at 6:34
add comment

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