Jump to content

arjanv

New Members
  • Posts

    1
  • Joined

  • Last visited

arjanv's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want a enable/disable option in my wordpress theme admin panel to enable or diable the main navigation menu. I know how to do this using php, but i need to make a change some javescript code in a .js file. but how to do this with php. i mean i have allready made the option in the theme adminpanel php file availeble, but it needs to do something in a .js file. i hope you understand what i mean. portion of the themoptions file: $dd_options[] = array( "name" => __("nav menu", "dd"), "desc" => __("Enable / Disable navigation menu", "dd"), "id" => "nav_menu", "std" => "1", "type" => "checkbox"); --------------------------------------------------------------- header.php: <?php if(!empty($nav_menu)) { ?> <?php if ( has_nav_menu( 'headermenu' ) ) { ?><?php wp_nav_menu ( array( 'menu_id' => 'nav','container'=> 'ul', 'theme_location' => 'headermenu' )); ?> <?php } else { ?> nothing <?php } ?> --------------------------------------------------------------- theme.js file: ddsmoothmenu.init({ mainmenuid: "menu", //menu DIV id orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" classname: 'navigation', //class added to menu's outer DIV //customtheme: ["#1c5a80", "#18374a"], contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] }) when i disable the menu it must disable the whole ddsmoothmenu in the javascript file. but how to do this? i'm a bit lost.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.