featureon/inc/page-title.php

54 lines
2.3 KiB
PHP
Raw Normal View History

2020-03-11 14:51:38 +01:00
<div class="page-title group">
<div class="container pad">
<?php if ( is_home() ) : ?>
2020-03-11 16:50:30 +01:00
<h2><strong><?php echo featureon_blog_title(); ?></strong></h2>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_single() ): ?>
<h2><strong><?php the_category(' <span>/</span> '); ?></strong></h2>
<?php elseif ( is_page() ): ?>
<h2><strong><?php the_title(); ?></strong></h2>
<?php elseif ( is_search() ): ?>
<h1><strong>
<?php if ( have_posts() ): ?><i class="fas fa-search"></i><?php endif; ?>
<?php if ( !have_posts() ): ?><i class="fas fa-exclamation-circle"></i><?php endif; ?>
<?php $search_results=$wp_query->found_posts;
if ($search_results==1) {
2020-03-11 16:50:30 +01:00
echo $search_results.' '.esc_html__('Search result','featureon');
2020-03-11 14:51:38 +01:00
} else {
2020-03-11 16:50:30 +01:00
echo $search_results.' '.esc_html__('Search results','featureon');
2020-03-11 14:51:38 +01:00
}
?>
</strong></h1>
<?php elseif ( is_404() ): ?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="fas fa-exclamation-circle"></i><?php esc_html_e('Error 404.','featureon'); ?> <span><?php esc_html_e('Page not found!','featureon'); ?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_author() ): ?>
<?php $author = get_userdata( get_query_var('author') );?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="far fa-user"></i><?php esc_html_e('Author:','featureon'); ?> <span><?php echo $author->display_name;?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_category() ): ?>
<h1><strong><?php echo single_cat_title('', false); ?></strong></h1>
<?php elseif ( is_tag() ): ?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="fas fa-tags"></i><?php esc_html_e('Tagged:','featureon'); ?> <span><?php echo single_tag_title('', false); ?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_day() ): ?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="far fa-calendar"></i><?php esc_html_e('Daily Archive:','featureon'); ?> <span><?php echo esc_html( get_the_time('F j, Y') ); ?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_month() ): ?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="far fa-calendar"></i><?php esc_html_e('Monthly Archive:','featureon'); ?> <span><?php echo esc_html( get_the_time('F Y') ); ?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php elseif ( is_year() ): ?>
2020-03-11 16:50:30 +01:00
<h1><strong><i class="far fa-calendar"></i><?php esc_html_e('Yearly Archive:','featureon'); ?> <span><?php echo esc_html( get_the_time('Y') ); ?></span></strong></h1>
2020-03-11 14:51:38 +01:00
<?php else: ?>
<h2><strong><?php the_title(); ?></strong></h2>
<?php endif; ?>
</div>
</div><!--/.page-title-->