11.05.2017
Самый простой вариант файла index.php в шаблоне CMS WordPress
<?php get_header(); ?> <div class="content"> <?php if (is_category()) { ?> <h1><?php single_cat_title(); ?></h1> <?php } elseif (is_day()) { ?> <h1><?php _e('Daily Archives:', 'crea'); ?> <?php echo esc_attr(get_the_date(get_option("date_format"))); ?></h1> <?php } elseif (is_month()) { ?> <h1><?php _e('Monthly Archives:', 'crea'); ?> <?php echo esc_html(get_the_date(get_option("date_format"))); ?></h1> <?php } elseif (is_year()) { ?> <h1><?php _e('Yearly Archives:', 'crea'); ?> <?php echo esc_html(get_the_date(get_option("date_format"))); ?></h1> <?php } elseif (is_search()) { ?> <h1><?php _e('Search results for:', 'crea'); ?> <?php echo esc_html(get_search_query()) ?></h1> <?php } elseif (is_tag()) { ?> <h1><?php _e('Tag Archives:', 'crea'); ?> <?php echo esc_attr(single_tag_title('', true)); ?></h1> <?php } elseif (is_author()) { ?> <h1><?php _e('By:', 'crea'); ?> <?php echo esc_attr(ucfirst(get_the_author())); ?></h1> <?php } else { ?> <h1><?php _e('Blog Archives:', 'crea'); ?> <?php echo esc_attr(ucfirst(get_the_author())); ?></h1> <?php } ?> <div class="loop-wrap"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'include/loop' ); endwhile; get_template_part('include/navigation'); endif; ?> </div><!-- /loop-wrap --> </div><!-- /top10-cat --> <?php get_footer(); ?>