Donate | Other Menu Styles Version: 4 Author: Isaac Rowntree Author URI: http://www.zackdesign.biz */ if (!class_exists("CSSDropDownMenu")) { class CSSDropDownMenu { var $orientation; var $name; var $container_class; var $theme_location; var $menu_class; function CSSDropDownMenu() { //constructor $this->orientation = 'top'; $this->name = null; $this->container_class = null; $this->theme_location = null; $this->menu_class = null; } function show() { $options = array(); switch ($this->orientation) { case 'right' : $options['container_class'] = $this->container_class; $options['menu'] = $this->name; $options['menu_class'] = $this->orientation.'-menu'; break; case 'left' : $options['menu'] = $this->name; $options['container_class'] = $this->container_class; $options['menu_class'] = $this->orientation.'-menu'; break; default : $options['theme_location'] = $this->theme_location; $options['menu'] = $this->name; $options['container_class'] = $this->container_class; if (!empty($this->menu_class)) : $options['menu_class'] = $this->menu_class; endif; if (get_option('wp_css_menu_jclass')) : $options['menu_class'] = get_option('wp_css_menu_jclass'); endif; break; } //print_r($options); if (function_exists('wp_nav_menu')) : wp_nav_menu($options); endif;// Now using the Wordpress nav menu builder } } } //End Class CSSDropDownMenu // Widget Class class CSS_DDMenu extends WP_Widget { function CSS_DDMenu() { parent::WP_Widget(false, $name = 'Dropdown Menu'); } function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); if ( $title ) echo $before_title . $title . $after_title; if (class_exists("CSSDropDownMenu")) { $cssMenu = new CSSDropDownMenu(); if (isset($instance['orientation'])) : $cssMenu->orientation = esc_attr($instance['orientation']); endif; if (isset($instance['name'])) : $cssMenu->name = esc_attr($instance['name']); endif; $cssMenu->show(); } echo $after_widget; } function update($new_instance, $old_instance) { return $new_instance; } function form($instance) { if (isset($instance['title'])) : $title = esc_attr($instance['title']); else : $title = ''; endif; if (isset($instance['name'])) : $name = esc_attr($instance['name']); else : $name = ''; endif; if (isset($instance['orientation'])) : $orientation = esc_attr($instance['orientation']); else : $orientation = ''; endif; $right = ''; $left = ''; $top = ''; if ($orientation == 'right') $right = 'selected="selected"'; else if ($orientation == 'left') $left = 'selected="selected"'; else if ($orientation == 'top') $top = 'selected="selected"'; ?>
$lili) $lili = $li - 21; $aa = $lili + 22; echo ' '; } } function include_CSSMenu_file() { // Show menu.css depending on what's available if (file_exists(TEMPLATEPATH.'/menu.css')) wp_enqueue_style('wp-css-dropdown-menu-style', get_bloginfo('template_directory').'/menu.css'); else wp_enqueue_style('wp-css-dropdown-menu-style', plugins_url('/theme_css/menu.css', __FILE__)); } add_action('wp_head', 'css_dropdownmenu_css'); add_action('init', 'include_CSSMenu_file'); // Deprecated function, reintroduced as people seem to be breaking their sites left right and centre. function wp_css_dropdownmenu() { echo 'Please visit the Installation guide to set up your menu properly as it has been changed (remember you can easily edit header.php). If you can\'t do it yourself visit Zack Design and contact us for help. Or, reinstall version 2.3.7'; } ?>