-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patharchive.php
44 lines (39 loc) · 1.55 KB
/
archive.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
<?php get_header(); ?>
<div class="featured-area">
<div class="featured-img" <?php
$page_for_posts = get_option('page_for_posts');
if (has_post_thumbnail($page_for_posts)) { // check if the post has a Post Thumbnail assigned to it.
$full_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($page_for_posts), 'full');
}else{
$full_image_url[0] = SD_DEFAULT_FEATURED_IMAGE;
}
?> style="background-image: url('<?php echo esc_url($full_image_url[0]); ?>');" <?php
?>>
</div>
<div class="header-wrap">
<h1 class="entry-title"><?php the_archive_title(); ?></h1>
</div>
</div>
<div class="container">
<div class="content-box content-archive">
<?php if (!have_posts()) : ?>
<div class="alert-error">
<p><?php _e('Sorry, no results were found.', 'supreme-directory'); ?></p>
</div>
<?php get_search_form(); ?>
<?php endif; ?>
<?php
while (have_posts()) : the_post();
// Include the page content template.
get_template_part('content-blog');
// End the loop.
endwhile;
// Previous/next page navigation.
the_posts_pagination(array(
'prev_text' => __('Previous', 'supreme-directory'),
'next_text' => __('Next', 'supreme-directory'),
));
?>
</div>
</div>
<?php get_footer(); ?>