name : 'post';
$f_id = get_option('featured-post--'.$post_type, false);
$featuredPost = new BenjaminFeaturedPost($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 benjamin_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 benjamin_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;
}
?>
' . '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() || is_archive() ){
$post = get_queried_object();
$post_type = is_a($post, 'WP_Post_Type') ? $post->name : 'post';
$fid = get_option('featured-post--'.$post_type, false);
if($fid) {
$featuredPost = new BenjaminFeaturedPost($fid, 'post');
$title = $featuredPost->output;
} elseif( $post->post_title ) {
$title = '' . $post->post_title . '
';
} elseif($post->name) {
$title = '' . $post->name . '
';
} else {
$title = ' Home
';
}
} elseif(is_404() ) {
$title = '404: Page not found.
';
} else {
$post = get_queried_object();
if( $post->post_title)
$title = $post->post_title;
elseif($post->name)
$title = $post->name;
$title = '' . $title .'
';
}
return $title;
}