-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
146 lines (122 loc) · 4.45 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* Template for common archive pages, author and search results
* @package themify
* @since 1.0.0
*/
?>
<?php get_header(); ?>
<?php
/** Themify Default Variables
* @var object */
global $themify;
?>
<!-- layout -->
<div id="layout-wrap">
<div id="layout" class="pagewidth clearfix">
<!-- content -->
<?php themify_content_before(); //hook ?>
<div id="content" class="clearfix">
<?php themify_content_start(); //hook ?>
<?php
/////////////////////////////////////////////
// Author Page
/////////////////////////////////////////////
if(is_author()) : ?>
<?php
global $author, $author_name;
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
$author_url = $curauth->user_url;
?>
<div class="author-bio clearfix">
<p class="author-avatar"><?php echo get_avatar( $curauth->user_email, $size = '48' ); ?></p>
<h2 class="author-name"><?php _e('About','themify'); ?> <?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?></h2>
<?php if($author_url != ''): ?><p class="author-url"><a href="<?php echo $author_url; ?>"><?php echo $author_url; ?></a></p><?php endif; //author url ?>
<div class="author-description">
<?php echo $curauth->user_description; ?>
</div>
<!-- /.author-description -->
</div>
<!-- /.author bio -->
<h2 class="author-posts-by"><?php _e('Posts by','themify'); ?> <?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?>:</h2>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// Search Title
/////////////////////////////////////////////
?>
<?php if( is_search() ): ?>
<h1 class="page-title"><?php _e('Search Results for:','themify'); ?> <em><?php echo get_search_query(); ?></em></h1>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// Date Archive Title
/////////////////////////////////////////////
?>
<?php if ( is_day() ) : ?>
<h1 class="page-title"><?php printf( __( 'Daily Archives: <span>%s</span>', 'themify' ), get_the_date() ); ?></h1>
<?php elseif ( is_month() ) : ?>
<h1 class="page-title"><?php printf( __( 'Monthly Archives: <span>%s</span>', 'themify' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'themify' ) ) ); ?></h1>
<?php elseif ( is_year() ) : ?>
<h1 class="page-title"><?php printf( __( 'Yearly Archives: <span>%s</span>', 'themify' ), get_the_date( _x( 'Y', 'yearly archives date format', 'themify' ) ) ); ?></h1>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// Category Title
/////////////////////////////////////////////
?>
<?php if( is_category() || is_tag() || is_tax() ): ?>
<h1 class="page-title"><?php single_cat_title(); ?></h1>
<?php echo themify_get_term_description(); ?>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// Default query categories
/////////////////////////////////////////////
?>
<?php if( !is_search() ): ?>
<?php
global $query_string;
query_posts( apply_filters( 'themify_query_posts_args', $query_string . '&order=' . $themify->order . '&orderby=' . $themify->orderby ) );
?>
<?php endif; ?>
<?php
/////////////////////////////////////////////
// Loop
/////////////////////////////////////////////
?>
<?php if (have_posts()) : ?>
<!-- loops-wrapper -->
<div id="loops-wrapper" class="loops-wrapper <?php echo $themify->layout . ' ' . $themify->post_layout; ?>">
<?php while (have_posts()) : the_post(); ?>
<?php if(is_search()): ?>
<?php get_template_part( 'includes/loop' , 'search'); ?>
<?php else: ?>
<?php get_template_part( 'includes/loop' , 'index'); ?>
<?php endif; ?>
<?php endwhile; ?>
</div>
<!-- /loops-wrapper -->
<?php get_template_part( 'includes/pagination'); ?>
<?php
/////////////////////////////////////////////
// Error - No Page Found
/////////////////////////////////////////////
?>
<?php else : ?>
<p><?php _e( 'Sorry, nothing found.', 'themify' ); ?></p>
<?php endif; ?>
<?php themify_content_end(); //hook ?>
</div>
<?php themify_content_after(); //hook ?>
<!-- /#content -->
<?php
/////////////////////////////////////////////
// Sidebar
/////////////////////////////////////////////
if ($themify->layout != "sidebar-none"): get_sidebar(); endif; ?>
</div>
<!-- /#layout -->
</div>
<!-- /#layout-wrap -->
<?php get_footer(); ?>