'Main Menu', 'secondary' => 'Footer Menu', 'extra' => 'Extra Menu' ) ); function add_menu_link_class( $atts, $item, $args ) { if (property_exists($args, 'link_class')) { $atts['class'] = $args->link_class; } return $atts; } add_filter( 'nav_menu_link_attributes', 'add_menu_link_class', 1, 3 ); class kit_custom_main_menu extends Walker_Nav_Menu { # Menu start, equivalent to
'; if ($i !== 0) { $excerptRet .= '... '; } $excerptRet .= $excerpt . ' ...
'; return $excerptRet; } function search_excerpt_highlight() { # Length in word count $excerptLength = 32; $text = wp_strip_all_tags( get_the_content() ); # Filter double quotes from query. They will # work on the results side but won't help with # text highlighting and displaying. $query=get_search_query(false); $query=str_replace('"','',$query); $query=esc_html($query); $query = explode(' ', $query); echo generate_excerpt($text, $query, $excerptLength); }