manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } /** * excerpt lenth. */ if (!function_exists('blog_town_custom_excerpt_length')) : function blog_town_custom_excerpt_length($length) { if (is_admin()) { return $length; } $excerpt_length = get_theme_mod('blog_town_excerpt_length','55'); if (!empty($excerpt_length)) { return $excerpt_length; } return 55; } endif; add_filter( 'excerpt_length', 'blog_town_custom_excerpt_length');