ThemeShaper Forums » Power Blog

[closed]

How to disable drop down menu

(11 posts)
  • Started 4 years ago by George71
  • Latest reply from twoandtwo
  1. Hi My name is George and I have a question about this site
    www.MindfulKids.nl I need to disable the dropdown menu.

    Can anyone tell me how this can be done?

    Thanx

    Posted 4 years ago #
  2. Add this to your child theme functions.php file:

    //  Add a dynamic menu using wp_list_pages
    
    function childtheme_menu() { ?>
         <div class="menu">
              <ul class="sf-menu">
                    <?php wp_list_pages('title_li=&depth=1'); ?>
              </ul>
         </div>
    <?php }
    
    add_action('wp_page_menu','childtheme_menu');

    More reference at http://wptheming.com/2009/11/filter-menus-in-thematic/

    Posted 4 years ago #
  3. Thanks for your help Devin.

    I am no good in php but I added the code:
    But it is not working
    When I exclude pages like this:
    <?php wp_list_pages('exclude=610,505'); ?>

    It replaces the whole menu with one word, "PAGES" and if I click on it there is one big dropdown menu with all pages listed...

    I want to keep the menu, only disable the dropdown function.
    I guess my question was not clear...

    Posted 4 years ago #
  4. You need to paste the code in the functions.php file of your child theme. I just tested it on a local copy and the snippet above works fine. If you also want to exclude pages, you'd do this:

    // Add a dynamic menu using wp_list_pages

    function childtheme_menu() { ?>
    <div class="menu">
    <ul class="sf-menu">
    <?php wp_list_pages('title_li=&depth=1&exclude=610,505'); ?>

    </div>
    <?php }

    add_action('wp_page_menu','childtheme_menu');

    Posted 4 years ago #
  5. jeah, it's working, thanx a lot Devin!

    I could nevver have figured this out myself, especcially this php stuf:
    ('title_li=&depth=1&exclude=610,505')

    SOLVED :-) :-)

    Posted 4 years ago #
  6. twoandtwo
    Member

    this works very well.
    i just have the problem that my HOME button now dissappears in the menu bar :/

    Posted 4 years ago #
  7. This would be something like:

    // Add a dynamic menu using wp_list_pages
    
    function childtheme_menu() { ?>
    <div class="menu">
    <ul class="sf-menu">
    <li><a href="<?php bloginfo('url'); ?>" title="<?php
    bloginfo('name'); ?> Home Page">Home</a></li>
    <?php wp_list_pages('title_li=&depth=1&exclude=610,505'); ?>
    
    </div>
    <?php }
    
    add_action('wp_page_menu','childtheme_menu');

    Chris

    Posted 4 years ago #
  8. twoandtwo
    Member

    wow. thank you for the quick reply, that works just great!
    now i just have to re-enable the active state of the home button, so it stays active on the frontpage.
    thanks so much for your help!

    Posted 4 years ago #
  9. Mmmmh .. 'sf-menu' like this would be:

    // Add a dynamic menu using wp_list_pages
    
    function childtheme_menu() { ?>
    <div class="menu">
    <ul class="sf-menu">
    <li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php bloginfo('url'); ?>" title="<?php
    bloginfo('name'); ?> Home Page">Home</a></li>
    <?php wp_list_pages('title_li=&depth=1&exclude=610,505'); ?>
    
    </div>
    <?php }
    
    add_action('wp_page_menu','childtheme_menu');

    :)

    Chris

    Posted 4 years ago #
  10. .. just a copy & paste from one of my other themes .. should work .. at least it should give you an idea ;)

    Posted 4 years ago #
  11. twoandtwo
    Member

    now this is perfect!
    i donĀ“t fully understand all that, but thanks so much for the clean solution!

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.