post_type; $f_id = get_option('featured-post--'.$post_type, false); $featuredPost = new FeaturedPost($f_id, $post_type); $hero_image = ($featuredPost && $featuredPost->image) ? $featuredPost->image : get_theme_mod($template . '_image_setting'); } return $hero_image; } /** * The hero has different sizes depending on which template is displayed * @param [type] $template [description] * @return [type] [description] */ function uswds_hero_size($template = null){ $setting = get_theme_mod($template . '_hero_size_setting'); $hero_size = $setting ? 'usa-hero--'.$setting : 'usa-hero--slim'; return $hero_size; } /** * The front page displays a "callout", here is the markup * @return [type] [description] */ function uswds_get_hero_callout(){ $page = ($id = get_theme_mod('frontpage_hero_callout_setting')) ? $id : null; $description = get_bloginfo( 'description', 'display' ); $title = get_bloginfo( 'name', 'display' ); if(!$title || !$description){ echo '

' . $title .'

'; return false; } ?>

Learn More
' . 'Posts by: '.$auth->nickname . ''; } elseif(is_date() ){ if( is_month()) $title = 'Posted in: ' . get_the_date('F, Y'); else $title = 'Posted in: ' . get_the_date('Y'); $title = '

' . $title .'

'; } elseif(is_category()){ ob_start(); single_cat_title(); $buffered_cat = ob_get_contents(); ob_end_clean(); $title = '

' . 'Posted in: '.$buffered_cat . '

'; } elseif(is_search()){ global $wp_query; $total_results = $wp_query->found_posts; $title = $total_results ? 'Search Results for: '.get_search_query() : 'No results found' ; $title = '

' . $title . '

'; } elseif(is_home() ){ $f_id = get_option('featured-post--post', false); $featuredPost = new FeaturedPost($f_id, 'post'); $title = $featuredPost->output; }else { $post = get_queried_object(); if( $post->post_title) $title = $post->post_title; elseif($post->name) $title = $post->name; '

' . $title .'

'; } return $title; }