This repository has been archived by the owner on Jun 11, 2022. It is now read-only.
forked from man4toman/Less-Reloaded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
240 lines (176 loc) · 6.58 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<link rel="profile" href="http://gmpg.org/xfn/11" />
<?php if(is_404()) {?><meta name="robots" content="noindex" /><?php } ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
} else {
do_action( 'wp_body_open' );
}
?>
<?php function showNotFoundMessage() { ?>
<article class="post error">
<h1 class="404"><?php esc_html_e( 'Nothing posted yet', 'less-revival' ); ?></h1>
</article>
<?php } ?>
<?php
/*-----------------------------------------------------------------------------------*/
/* Start header
/*-----------------------------------------------------------------------------------*/
?>
<header id="masthead" class="site-header">
<div class="container">
<div class="avatar">
<?php
$logo_url = get_template_directory_uri() . '/dummy-avatar.png';
if ( has_custom_logo() ) {
$custom_logo_id = get_theme_mod( 'custom_logo' );
$custom_logo_data = wp_get_attachment_image_src( $custom_logo_id , 'full' );
$logo_url = $custom_logo_data[0];
}
?>
<img alt="author" src="<?php echo esc_url($logo_url); ?>" class="avatar avatar-100 photo" height="100" width="100">
</div><!-- /author -->
<div id="brand">
<span class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php echo esc_attr( get_bloginfo( 'name' ) ); ?></a> — <span><?php echo esc_attr( get_bloginfo( 'description' ) ); ?></span></span>
</div><!-- /brand -->
<nav class="site-navigation main-navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- .site-navigation .main-navigation -->
<div class="clear"></div>
</div><!--/container -->
</header><!-- #masthead .site-header -->
<div class="container">
<div id="primary">
<div id="content" role="main">
<?php
/*-----------------------------------------------------------------------------------*/
/* Start Home loop
/*-----------------------------------------------------------------------------------*/
if( is_home() || is_archive() ) {
?>
<?php if ( have_posts() ) { ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class="post">
<div class="post-date">
<?php the_time('d/m/Y'); ?>
</div>
<h1 class="title">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_title() ?>
</a>
</h1>
<div class="the-content">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_content( __( 'Continue reading...', 'less-revival' ) ); ?>
<?php wp_link_pages(); ?>
</div>
</div><!-- the-content -->
<div class="meta clearfix">
<div class="category"><?php the_category(); ?></div>
<div class="tags"><?php the_tags( '| ', ' ' ); ?></div>
</div><!-- Meta -->
</article>
<?php endwhile; ?>
<!-- pagintation -->
<div id="pagination" class="clearfix">
<div class="past-page"><?php previous_posts_link( __( 'Newer »', 'less-revival' ) ); ?></div>
<div class="next-page"><?php next_posts_link( __( ' « Older', 'less-revival' ) ); ?></div>
</div><!-- pagination -->
<?php
} else {
showNotFoundMessage();
}
?>
<?php } //end is_home(); ?>
<?php
/*-----------------------------------------------------------------------------------*/
/* Start Single loop
/*-----------------------------------------------------------------------------------*/
if( is_single() ) {
?>
<?php if ( have_posts() ) { ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class="post">
<div class="post-date">
<?php the_time('d/m/Y'); ?>
</div>
<h1 class="title"><?php the_title() ?></h1>
<div class="the-content">
<?php the_content( __( 'Continue reading...', 'less-revival' ) ); ?>
<?php wp_link_pages(); ?>
</div><!-- the-content -->
<div class="meta clearfix">
<div class="category"><?php the_category(); ?></div>
<div class="tags"><?php the_tags( '| ', ' ' ); ?></div>
</div><!-- Meta -->
</article>
<?php endwhile; ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) {
comments_template( '', true );
}
?>
<?php
} else {
showNotFoundMessage();
}
?>
<?php } //end is_single(); ?>
<?php
/*-----------------------------------------------------------------------------------*/
/* Start Page loop
/*-----------------------------------------------------------------------------------*/
if( is_page()) {
?>
<?php if ( have_posts() ) { ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class="post">
<h1 class="title"><?php the_title() ?></h1>
<div class="the-content">
<?php the_content(); ?>
<?php wp_link_pages(); ?>
</div><!-- the-content -->
</article>
<?php endwhile; ?>
<?php
} else {
showNotFoundMessage();
}
?>
<?php } // end is_page(); ?>
<?php
/*-----------------------------------------------------------------------------------*/
/* Start 404 Page
/*-----------------------------------------------------------------------------------*/
if( is_404()) {
showNotFoundMessage();
}
?>
</div><!-- #content .site-content -->
</div><!-- #primary .content-area -->
</div><!-- / container-->
<?php
/*-----------------------------------------------------------------------------------*/
/* Start Footer
/*-----------------------------------------------------------------------------------*/
?>
<footer class="site-footer">
<div class="site-info container">
<a href="https://wordpress.org/" title="<?php esc_html_e( 'A Semantic Personal Publishing Platform', 'less-revival'); ?>" rel="generator"><?php esc_html_e( 'Powered by WordPress', 'less-revival'); ?></a>
<span class="sep"> <?php esc_html_e( 'and', 'less-revival' ); ?> </span>
<a href="https://thingsandcode.com/less-revival.html"><?php esc_html_e('theme Less Revival', 'less-revival'); ?></a>.
</div><!-- .site-info -->
</footer><!-- #colophon .site-footer -->
<?php wp_footer(); ?>
</body>
</html>