'Main Menu', 'secondary' => 'Footer Menu' ) ); }; add_action( 'after_setup_theme', 'kit_setup' ); class kit_custom_main_menu extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { // depth dependent classes $indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent $display_depth = ( $depth + 1); // because it counts the first submenu as 0 $classes = array( 'sub-menu', 'menu-depth-' . $display_depth ); $class_names = implode( ' ', $classes ); // build html if ($display_depth == 1) { $output .= "\n" . $indent . ' ' . "\n"; } else { $output .= "\n" . $indent . '' . "\n"; } } function start_el(&$output, $item, $depth = 0, $args=array(), $id = 0) { $object = $item->object; $type = $item->type; $title = $item->title; $description = $item->description; $permalink = $item->url; $theme_template_path = get_template_directory_uri(); if ($depth == 1) { $output .= '
'; } else { $output .= ''; } } } function theme_customize_register( $wp_customize ) { $wp_customize->add_setting( 'theme_color', array( 'default' => '#009982', 'transport' => 'refresh', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'theme_color', array( 'section' => 'colors', 'label' => esc_html__( 'Theme color', 'theme' ), ) ) ); $wp_customize->add_setting('contact_mail', array( 'default' => '', 'type' => 'option', 'transport' => 'refresh', )); $wp_customize->add_control('contact_mail', array( 'label' => __('Contact mail', 'contact_mail'), 'section' => 'core', 'settings' => 'contact_mail', )); } add_action( 'customize_register', 'theme_customize_register' ); function kit_customize_css() { ?> is_search() ) { $query->set( 'posts_per_page', '10' ); } } add_action( 'pre_get_posts', 'kit_modify_posts_per_page' ); function highlight_results($text) { if (is_search() && !is_admin()) { $sr = get_query_var('s'); $keys = explode(' ', $sr); $keys = array_filter($keys); $text = preg_replace('/('.implode('|', $keys) .')/iu', '\0', $text); } return $text; } add_filter('the_excerpt', 'highlight_results'); add_filter('the_title', 'highlight_results');