4. Change Default Options
QuadMenu allows you to change the default settings. These are the settings that the user will see the first time he enters the in the configuration panel.
You can change the default settings in any tab of the admin panel by adding a filter in the functions.php file of your theme. Note that these options can be overridden by the user.
4.1. Configuration Tab
You can change any of the options in this tab by adding a filter in the functions.php file of your template. Note that these options can be overridden by the user.
add_filter('quadmenu_default_options', 'my_hook_default_options_configuration', 1); function my_hook_default_options_configuration($defaults) { $defaults['quadmenu_viewport'] = 1; $defaults['quadmenu_styles'] = 1; $defaults['quadmenu_styles_normalize'] = 1; $defaults['quadmenu_styles_widgets'] = 1; $defaults['quadmenu_icons'] = 'fontawesome'; $defaults['quadmenu_styles_pscrollbar'] = 1; return $defaults; }
4.2. Responsive Tab
You can change any of the options in this tab by adding a filter in the functions.php file of your template. Note that these options will be applied to all menus.
add_filter('quadmenu_default_options', 'my_hook_default_options_responsive', 1); function my_hook_default_options_general($defaults) { $defaults['gutter'] = '30'; $defaults['screen_sm_width'] = '768'; $defaults['screen_md_width'] = '992'; $defaults['screen_lg_width'] = '1200'; return $defaults; }
4.3. Social Tab
You can change the default social networks by adding this filter in your functions.php file.
add_filter('quadmenu_default_options', 'my_hook_default_options_social'); function my_hook_default_options_social($defaults) { $defaults['quadmenu_social'] = array( array( 'title' => 'Facebook', 'icon' => 'fa fa-facebook-f', 'url' => 'http://codecanyon.net/user/quadlayers/portfolio?ref=quadlayers', ), array( 'title' => 'Twitter', 'icon' => 'fa fa-twitter', 'url' => 'http://codecanyon.net/user/quadlayers/portfolio?ref=quadlayers', ), array( 'title' => 'Google Wallet', 'icon' => 'fa fa-google-wallet', 'url' => 'http://codecanyon.net/user/quadlayers/portfolio?ref=quadlayers', ), array( 'title' => 'Github', 'icon' => 'fa fa-github-alt', 'url' => 'http://codecanyon.net/user/quadlayers/portfolio?ref=quadlayers', ), array( 'title' => 'RSS', 'icon' => 'fa fa-rss', 'url' => 'http://codecanyon.net/user/quadlayers/portfolio?ref=quadlayers', ), ); return $defaults; }
4.4. Customize Tab
The easiest way to introduce some minor CSS customizations it is through the QuadMenu CSS tab. As the user can do it from the administration panel, developers can do so by adding a filter in functions.php.
<?php add_filter('quadmenu_default_options', 'my_hook_default_options_css'); function my_hook_default_options_css($css = '') { $css = '.custom {}'; // accepted values : valid css return $css; }
4.5. All Theme Settings
You can change the default options in the plugin by adding a filter in the functions.php file of your template. Note that these options will be applied as defaults to all menu locations.
add_filter('quadmenu_default_options_themes', 'my_hook_default_options_themes', 1); function my_hook_default_options_themes($defaults) { // Layout // ------------------------------------------------------------------------- $defaults['layout'] = 'collapse'; $defaults['layout_offcanvas_float'] = 'right'; $defaults['layout_align'] = 'right'; $defaults['layout_sticky'] = 1; $defaults['layout_sticky_offset'] = '90'; $defaults['layout_separator'] = ''; $defaults['layout_caret'] = 'show'; $defaults['layout_trigger'] = 'hoverintent'; $defaults['layout_classes'] = 'my_class'; $defaults['layout_breakpoint'] = '768'; $defaults['layout_hover_effect'] = ''; $defaults['layout_current'] = ''; $defaults['layout_animation'] = 'quadmenu_btt'; // Navbar // ------------------------------------------------------------------------- $defaults['navbar_logo'] = array( 'url' => QUADMENU_URL . 'assets/frontend/images/logo.png' ); $defaults['navbar_height'] = '60'; $defaults['navbar_width'] = '260'; $defaults['navbar_toggle_icon'] = '#ffffff'; $defaults['navbar_toggle_hover'] = '#444444'; $defaults['navbar_background'] = 'color'; $defaults['navbar_background_color'] = array( 'color' => '#333333', 'alpha' => '1' ); $defaults['navbar_background_to'] = array( 'color' => '#000000', 'alpha' => '1' ); $defaults['navbar_background_deg'] = '17'; $defaults['navbar_sharp'] = array( 'color' => '#ffffff', 'alpha' => '0.5' ); $defaults['navbar_text'] = '#aaaaaa'; $defaults['navbar_logo_bg'] = array( 'color' => '#ffffff', 'alpha' => '0' ); $defaults['navbar_logo_height'] = '40'; $defaults['navbar_link'] = '#f1f1f1'; $defaults['navbar_link_hover'] = '#ffffff'; $defaults['navbar_link_bg_hover'] = array('color' => '#111111', 'alpha' => '1'); $defaults['navbar_scrollbar'] = '#fb88dd'; $defaults['navbar_scrollbar_rail'] = '#ffffff'; $defaults['navbar_button'] = '#ffffff'; $defaults['navbar_button_bg'] = '#fb88dd'; $defaults['navbar_button_hover'] = '#ffffff'; $defaults['navbar_button_bg_hover'] = '#000000'; $defaults['navbar_link_hover_effect'] = array('color' => '#fb88dd', 'alpha' => '1'); $defaults['navbar_link_margin'] = array('border-top' => '0', 'border-right' => '0', 'border-left' => '0', 'border-bottom' => '0'); $defaults['navbar_link_radius'] = 0; $defaults['navbar_link_transform'] = 'uppercase'; $defaults['navbar_link_icon'] = '#eeeeee'; $defaults['navbar_link_icon_hover'] = '#ffffff'; $defaults['navbar_link_subtitle'] = '#eeeeee'; $defaults['navbar_link_subtitle_hover'] = '#ffffff'; $defaults['navbar_badge'] = '#fb88dd'; $defaults['navbar_badge_color'] = '#ffffff'; $defaults['layout_sticky_height'] = '60'; $defaults['layout_sticky_background'] = array('color' => '#ffffff', 'alpha' => '0'); $defaults['layout_sticky_logo_height'] = '40'; // Dropdown // ------------------------------------------------------------------------- $defaults['dropdown_margin'] = 0; $defaults['dropdown_radius'] = 0; $defaults['dropdown_border'] = array('border-all' => '3', 'border-top' => '0', 'border-color' => '#000000'); $defaults['dropdown_background'] = array('color' => '#111111', 'alpha' => '1'); $defaults['dropdown_scrollbar'] = '#fb88dd'; $defaults['dropdown_scrollbar_rail'] = '#ffffff'; $defaults['dropdown_title'] = '#ffffff'; $defaults['dropdown_title_border'] = array('border-all' => '1', 'border-top' => '1', 'border-color' => '#fb88dd', 'border-style' => 'solid'); $defaults['dropdown_link'] = '#cccccc'; $defaults['dropdown_link_hover'] = '#fb88dd'; $defaults['dropdown_link_bg_hover'] = array('color' => '#000000', 'alpha' => '1'); $defaults['dropdown_link_border'] = array('border-all' => '1', 'border-top' => '1', 'border-color' => '#000000', 'border-style' => 'solid'); $defaults['dropdown_link_transform'] = 'none'; $defaults['dropdown_button'] = '#ffffff'; $defaults['dropdown_button_bg'] = '#fb88dd'; $defaults['dropdown_button_hover'] = '#ffffff'; $defaults['dropdown_button_bg_hover'] = '#000000'; $defaults['dropdown_link_icon'] = '#fb88dd'; $defaults['dropdown_link_icon_hover'] = '#a9a9a9'; $defaults['dropdown_link_subtitle'] = '#a0a0a0'; $defaults['dropdown_link_subtitle_hover'] = '#cccccc'; return $defaults; }
4.6. Specific Theme Settings
You can change any of the options for a specific theme menu. The filter is almost the same as All Themes, but you have to include the themes slug into the filters name.
add_filter('quadmenu_default_options_theme_{YOUR_THEME_LOCATION}', 'my_hook_default_options_theme', 1); function my_hook_default_options_theme($defaults) { // Layout // ------------------------------------------------------------------------- $defaults['layout'] = 'collapse'; $defaults['layout_offcanvas_float'] = 'right'; $defaults['layout_align'] = 'right'; $defaults['layout_sticky'] = 1; $defaults['layout_sticky_offset'] = '90'; $defaults['layout_separator'] = ''; $defaults['layout_caret'] = 'show'; $defaults['layout_trigger'] = 'hoverintent'; $defaults['layout_classes'] = 'my_class'; $defaults['layout_breakpoint'] = '768'; $defaults['layout_hover_effect'] = ''; $defaults['layout_current'] = ''; $defaults['layout_animation'] = 'quadmenu_btt'; // Navbar // ------------------------------------------------------------------------- $defaults['navbar_logo'] = array( 'url' => QUADMENU_URL . 'assets/frontend/images/logo.png' ); $defaults['navbar_height'] = '60'; $defaults['navbar_width'] = '260'; $defaults['navbar_toggle_icon'] = '#ffffff'; $defaults['navbar_toggle_hover'] = '#444444'; $defaults['navbar_background'] = 'color'; $defaults['navbar_background_color'] = array( 'color' => '#333333', 'alpha' => '1' ); $defaults['navbar_background_to'] = array( 'color' => '#000000', 'alpha' => '1' ); $defaults['navbar_background_deg'] = '17'; $defaults['navbar_sharp'] = array( 'color' => '#ffffff', 'alpha' => '0.5' ); $defaults['navbar_text'] = '#aaaaaa'; $defaults['navbar_logo_bg'] = array( 'color' => '#ffffff', 'alpha' => '0' ); $defaults['navbar_logo_height'] = '40'; $defaults['navbar_link'] = '#f1f1f1'; $defaults['navbar_link_hover'] = '#ffffff'; $defaults['navbar_link_bg_hover'] = array('color' => '#111111', 'alpha' => '1'); $defaults['navbar_scrollbar'] = '#fb88dd'; $defaults['navbar_scrollbar_rail'] = '#ffffff'; $defaults['navbar_button'] = '#ffffff'; $defaults['navbar_button_bg'] = '#fb88dd'; $defaults['navbar_button_hover'] = '#ffffff'; $defaults['navbar_button_bg_hover'] = '#000000'; $defaults['navbar_link_hover_effect'] = array('color' => '#fb88dd', 'alpha' => '1'); $defaults['navbar_link_margin'] = array('border-top' => '0', 'border-right' => '0', 'border-left' => '0', 'border-bottom' => '0'); $defaults['navbar_link_radius'] = 0; $defaults['navbar_link_transform'] = 'uppercase'; $defaults['navbar_link_icon'] = '#eeeeee'; $defaults['navbar_link_icon_hover'] = '#ffffff'; $defaults['navbar_link_subtitle'] = '#eeeeee'; $defaults['navbar_link_subtitle_hover'] = '#ffffff'; $defaults['navbar_badge'] = '#fb88dd'; $defaults['navbar_badge_color'] = '#ffffff'; $defaults['layout_sticky_height'] = '60'; $defaults['layout_sticky_background'] = array('color' => '#ffffff', 'alpha' => '0'); $defaults['layout_sticky_logo_height'] = '40'; // Dropdown // ------------------------------------------------------------------------- $defaults['dropdown_margin'] = 0; $defaults['dropdown_radius'] = 0; $defaults['dropdown_border'] = array('border-all' => '3', 'border-top' => '0', 'border-color' => '#000000'); $defaults['dropdown_background'] = array('color' => '#111111', 'alpha' => '1'); $defaults['dropdown_scrollbar'] = '#fb88dd'; $defaults['dropdown_scrollbar_rail'] = '#ffffff'; $defaults['dropdown_title'] = '#ffffff'; $defaults['dropdown_title_border'] = array('border-all' => '1', 'border-top' => '1', 'border-color' => '#fb88dd', 'border-style' => 'solid'); $defaults['dropdown_link'] = '#cccccc'; $defaults['dropdown_link_hover'] = '#fb88dd'; $defaults['dropdown_link_bg_hover'] = array('color' => '#000000', 'alpha' => '1'); $defaults['dropdown_link_border'] = array('border-all' => '1', 'border-top' => '1', 'border-color' => '#000000', 'border-style' => 'solid'); $defaults['dropdown_link_transform'] = 'none'; $defaults['dropdown_button'] = '#ffffff'; $defaults['dropdown_button_bg'] = '#fb88dd'; $defaults['dropdown_button_hover'] = '#ffffff'; $defaults['dropdown_button_bg_hover'] = '#000000'; $defaults['dropdown_link_icon'] = '#fb88dd'; $defaults['dropdown_link_icon_hover'] = '#a9a9a9'; $defaults['dropdown_link_subtitle'] = '#a0a0a0'; $defaults['dropdown_link_subtitle_hover'] = '#cccccc'; return $defaults; }