ThemeShaper Forums » Thematic

[closed]

hiding pages from navigation

(8 posts)
  • Started 3 years ago by Degran
  • Latest reply from em hr
  • This topic is resolved
  1. Degran
    Member

    I've been building my own child theme on top of the thematic framework and I've run into a bit of an issue. I've got pages that I want to add, that can still be accessed by the public, but aren't listed in the nav bar. I've been trying the best way to go about solving this issue but seem have run into a wall. I can obviously add them as child pages of others on my nav bar but some of them I would rather just have stand alone. Any direction would be greatly appreciated.

    Posted 3 years ago #
  2. i can't tell if you are trying to exclude pages from the menu or add them. why not just use wordpress 3.0's menu feature and have a totally custom menu however you want?

    add_theme_support( 'menus' );
    
    function child_access_menu() {
                  $menu_sys = 'wp_nav_menu';
                  return $menu_sys;
    }
    
    add_filter('thematic_menu_type', 'child_access_menu');
    Posted 3 years ago #
  3. Note: that this will only work with 0.9.7.3 (pre-release) or the current stable svn version as the current release version 0.9.6.2 does not contain this filter hook. The next release of
    -Gene

    Posted 3 years ago #
  4. Degran
    Member

    I guess I wasn't very clear in my first post. I am trying to modify the horizontal navigation bar at the top to exclude certain pages from being displayed. I've given the new menus function a shot but I can't get it to work with my CSS formating, most likely because it's accessing wp_nav_menu instead of wp_page_menu. It's probably my lack of knowledge of the framework but I'm not sure how to convert the CSS over to the other menu or if it's possible to integrate my 3.0 menu into wp_page_menu.

    *To clarify I'm using the standard NAV Skin CSS files from the Thematic framework so .sf-menu etc.

    Posted 3 years ago #
  5. my bad gene. i forget about that all the time.

    when you were using 3.0 menus you probably didnt use all the arguments available to you.

    http://codex.wordpress.org/Function_Reference/wp_nav_menu

    you can add an id and a class to the containing div as well as a class to the menu. if you add "menu" as the containing class and "sf-menu" as the menu class you should reproduce the thematic markup and thus get the right css.

    for instance:

    wp_nav_menu( array(
    'theme_location' => 'primary-menu',
    'menu_class' => 'sf-menu',
    'container_class' => 'menu',
    ));

    the answer to excluding/including pages in the page menu is also in the arguments
    http://codex.wordpress.org/Template_Tags/wp_page_menu

    if you know your menu isn't going to change you can 'include' the pages you want and any new pages will not be added.

    but i would take a look again at the 3.0 system and see if you can't get the right markup.

    Posted 3 years ago #
  6. Hybrion
    Member

    There's a plugin for that: exclude pages, see http://wordpress.org/extend/plugins/exclude-pages/.

    I had the same problem and just installed this on my WP 3.0.1 - plugin works great and does what it says.

    Posted 3 years ago #
  7. I agree with Hybrion, that plugin makes life so much easier!

    Posted 3 years ago #
  8. Hi,

    Heads up using add_theme_support in this way is not advised

    ref: http://forums.themeshaper.com/topic/add_theme_supportmenus

    -Gene

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.