This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
executable file
·75 lines (63 loc) · 2.11 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme and one of the
* two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package Trim
* @link https://themebeans.com/themes/trim
*/
get_header();
if ( is_archive() ) { ?>
<article class="post archive-head format-quote">
<div class="vert-align">
<?php
if ( is_category() ) {
$page_title = sprintf( __( 'All Posts in %s', 'trim' ), single_cat_title( '', false ) );
} elseif ( is_tag() ) {
$page_title = sprintf( __( 'All Posts in %s', 'trim' ), single_tag_title( '', false ) );
} elseif ( is_date() ) {
if ( is_month() ) {
$page_title = sprintf( __( 'Archive for: %s', 'trim' ), get_the_time( 'F, Y' ) );
} elseif ( is_year() ) {
$page_title = sprintf( __( 'Archive for: %s', 'trim' ), get_the_time( 'Y' ) );
} elseif ( is_day() ) {
$page_title = sprintf( __( 'Archive for: %s', 'trim' ), get_the_time( get_option( 'date_format' ) ) );
} else {
$page_title = __( 'Archives', 'trim' );
}
} elseif ( is_author() ) {
if ( get_query_var( 'author_name' ) ) {
$curauth = get_user_by( 'login', get_query_var( 'author_name' ) );
} else {
$curauth = get_userdata( get_query_var( 'author' ) );
}
$author_name = $curauth->display_name;
$title = sprintf( __( 'Articles by %s', 'trim' ), $author_name );
$page_title = $author_avatar . $title;
} else {
$page_title = single_term_title( '', false );
}
?>
<h2 class="entry-title"><?php echo esc_html( $page_title ); ?></h2>
</div><!-- END.archive-head -->
</article><!-- END.archive-head -->
<?php
}
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'loop-post' ); // PULL LOOP-POST.PHP
endwhile;
endif;
?>
<div id="page_nav" class="hide">
<?php next_posts_link(); ?>
</div><!-- END #page_nav -->
<?php
get_footer();