WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I run a membership site and I want to add a tab to the navigation menu that says, "My Subscriptions" and then add certain pages to that tab, which will be specific for each member depending whether or not they have access to the content.

Right now I just have 20 different menus and 20 different if statements in the PHP file and it is not very efficient, not to mention the amount of menus I have to create tenfold if I want to add more content.

Basically, I need some piece of code in the menu PHP file that says :

if member_is_logged_in('1') {
    add content 1 to "My Subscriptions
} elseif member_is_logged_in('2') {
    add content 2 to "My Subscriptions

Can anyone help me out with this? Thanks!

share|improve this question

If you use wp_nav_menu() to display your menu, you can add items to it by filtering wp_nav_menu_items, wp_nav_menu_{$menu_slug}_items, or wp_nav_menu

share|improve this answer
That sounds like exactly what I need, but I'm not sure how I would use them to add menu items? – Stephen Sep 11 '12 at 4:21

Your Answer


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.