-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
51 lines (48 loc) · 1.93 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
<?php get_header(); ?>
<?php if (!is_front_page()) { ?>
<header class="page-header wp-block-group has-global-padding is-layout-constrained">
<h1 class="headline wp-block-post-title">
<?php
if (is_home() && !is_front_page() && single_post_title()) {
single_post_title();
} elseif (is_archive()) {
the_archive_title();
} elseif (is_search()) {
echo 'Search Results for "' . esc_html(get_search_query()) . '"';
}
?>
</h1>
<?php if (is_archive() && !empty(get_the_archive_description())) { ?>
<div class="term-description wp-block-group alignfull has-global-padding is-layout-constrained has-gray-wash-background-color">
<?php the_archive_description(); ?>
</div>
<?php } ?>
<?php
if (is_search()) {
?>
<form role="search" method="get" action="<?php echo esc_url(home_url()); ?>http://robots.local/" class="wp-block-search__button-outside wp-block-search__text-button wp-block-search">
<label for="wp-block-search__input-1" class="wp-block-search__label screen-reader-text">Search</label>
<div class="wp-block-search__inside-wrapper ">
<input type="search" id="wp-block-search__input-1" class="wp-block-search__input " name="s" value="<?php echo esc_attr(get_search_query()); ?>" placeholder="" required="">
<button type="submit" class="wp-block-search__button wp-element-button">Search</button>
</div>
</form>
<?php
}
?>
</header>
<?php } ?>
<div class="posts wp-block-query has-global-padding is-layout-constrained">
<?php if (have_posts()) { ?>
<?php
while (have_posts()) {
the_post();
get_template_part('template-parts/loop-index');
}
the_posts_pagination();
?>
<?php } else { ?>
<p><?php _e('No posts match your query.', 'cpt-theme'); ?></p>
<?php } ?>
</div>
<?php get_footer(); ?>