Display only child pages in navigation bar

7 replies
  • WEB DESIGN
  • |
I'm working with a new WordPress install, and I'm like to know if there's a plugin (or other way) to show JUST the child pages of a certain page in the navigation bar at the top (or in my secondary navigation bar), not in the sidebar or a drop-down.

So, if I had:

Page 1
- child 1a
- child 1b
- child 1c
Page 2
- child 2a
- child 2b
- child 2c

I would want child 1a, child 1b, and child 1c visible in the navigation bar at the top if a visitor was on Page 1. And child 2a, child 2b, and child 2c to be visible only on Page 2.

I feel so close, it's just not quite within reach yet...

A theme or framework to display a custom menu on each page would work too. in fact, that would probably be better...
#bar #child #display #navigation #pages
  • Profile picture of the author clickbump
    If your theme supports wordpress custom menus, you can do roll your own menu as you describe. Go to "Appearance > Menus" and see if your theme has support for this feature. If so, keep reading...

    Here's how I do it on my theme. If your theme supports custom menus, it will be the virtually same process:

    Signature
    {{ DiscussionBoard.errors[7138911].message }}
    • Profile picture of the author CJWrite
      Oh, I've got the custom menus down, but I don't want a drop downs. I need different menus on different pages. I figured one of the easiest ways to do this would be to display only the child pages of a certain page in the navigation bar. Apparently this simple task is more difficult than it needs to be. I've been able to modify the code to display a list of the child pages - but they're just a plain list under the header, not in the navigation bar.
      {{ DiscussionBoard.errors[7141282].message }}
  • Profile picture of the author Istvan Horvath
    Scott absolutely didn't understand your question... (He's more interested in pushing his product than to read carefully the questions).

    It can be done but you will need to mess a bit with the code in the header.php (if displayed as top horizontal menu) or sidebar.php (if displayed there).
    The basic code is here:
    Function Reference/wp list pages « WordPress Codex
    Signature

    {{ DiscussionBoard.errors[7141563].message }}
    • Profile picture of the author CJWrite
      Originally Posted by Istvan Horvath View Post

      Scott absolutely didn't understand your question... (He's more interested in pushing his product than to read carefully the questions).

      It can be done but you will need to mess a bit with the code in the header.php (if displayed as top horizontal menu) or sidebar.php (if displayed there).
      The basic code is here:
      Argh!! I'm sort of figuring it out, and i've been messing with the code in the header.php file. However, I've started messing with the wp_nav_menu instead of the list_pages. I kind of have it working, but it only lists the pages vertically, not in a navigation bar under the header image where I want it.

      I've come to the conclusion that WP is more of a badly behaved child than a blogging platform. I think I may even go as far as to say that my own children are more well-behaved than WP...

      Of course, I think I'm a little out of my element. To borrow a phrase from Hunter S. - I'm a Doctor of Journalism, dammit! Not a programmer!
      {{ DiscussionBoard.errors[7142745].message }}
  • Profile picture of the author CJWrite
    EUREKA!!!

    Menu Item Visibility Control (plugin)

    Does just what I need it to....
    {{ DiscussionBoard.errors[7145852].message }}
  • Profile picture of the author Masinizator
    Exclude Pages - free plugin for WP
    {{ DiscussionBoard.errors[7157000].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by Masinizator View Post

      Exclude Pages - free plugin for WP
      Next time read the thread before posting your irrelevant reply - unless you want them deleted.
      Signature

      {{ DiscussionBoard.errors[7158087].message }}

Trending Topics