-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
57 lines (47 loc) · 1.58 KB
/
index.php
File metadata and controls
57 lines (47 loc) · 1.58 KB
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
<?php
declare(strict_types=1);
/**
* Fallback template.
*
* @package Spartan
*/
defined('ABSPATH') || exit;
get_header();
?>
<main id="primary" class="spartan-main" role="main">
<?php if (have_posts()) : ?>
<?php if (is_home() && ! is_front_page()) : ?>
<header class="spartan-entry-header">
<h1 class="spartan-entry-title"><?php single_post_title(); ?></h1>
</header>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('spartan-entry'); ?>>
<header class="spartan-entry-header">
<h2 class="spartan-entry-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<div class="spartan-entry-meta">
<?php echo esc_html(get_the_date()); ?> — <?php the_author(); ?>
</div>
</header>
<div class="spartan-entry-content">
<?php the_excerpt(); ?>
</div>
</article>
<?php endwhile; ?>
<div class="spartan-pagination">
<?php
the_posts_pagination([
'prev_text' => esc_html__('« Previous', 'spartan'),
'next_text' => esc_html__('Next »', 'spartan'),
]);
?>
</div>
<?php else : ?>
<p><?php esc_html_e('No posts found.', 'spartan'); ?></p>
<?php endif; ?>
</main>
<?php
get_sidebar();
get_footer();