theme_location && $item->description ) { $item_output = str_replace( $args->link_after . '', '' . $args->link_after . '', $item_output ); } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'mardi_gras_menu_description', 10, 4 ); } if ( ! function_exists( 'mardi_gras_search_form_modify' ) && ! get_theme_mod( 'mardi_gras_hide_search' ) ) { /** * If the option for the search form in the admin bar is active, add a new class to help us hide the submit button. */ function mardi_gras_search_form_modify( $html ) { return str_replace( 'class="search-submit"', 'class="search-submit search-screen-reader-text"', $html ); } add_filter( 'get_search_form', 'mardi_gras_search_form_modify' ); } if ( ! function_exists( 'mardi_gras_excerpt_length' ) ) { /** * Updates the length of the excerpt. */ function mardi_gras_excerpt_length( $length ) { if ( ! is_admin() ) { return 35; } else { return $length; } } add_filter( 'excerpt_length', 'mardi_gras_excerpt_length', 999 ); } if ( ! function_exists( 'mardi_gras_excerpt_more' ) ) { /** * Updates the excerpt_more text and includes a link to the post. */ function mardi_gras_excerpt_more( $more ) { if ( ! is_admin() ) { global $post; return '…

' . /* translators: %s: post title */ sprintf( esc_html__( 'Continue Reading %s', 'mardi-gras' ), get_the_title( $post->ID ) ) . ''; } else { return $more; } } add_filter( 'excerpt_more', 'mardi_gras_excerpt_more' ); }