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
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
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/
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...
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');
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 :-) :-)
this works very well.
i just have the problem that my HOME button now dissappears in the menu bar :/
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
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!
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
.. just a copy & paste from one of my other themes .. should work .. at least it should give you an idea ;)
now this is perfect!
i don“t fully understand all that, but thanks so much for the clean solution!
This topic has been closed to new replies.