-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.php
57 lines (50 loc) · 2.01 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
<?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
if ( is_search() ) {
echo __('Your Search Results for ', 'supreme-directory').get_search_query(true);
} else {
echo get_the_title($page_for_posts);
}
?>
</h1>
<?php if (get_post_meta($page_for_posts, 'subtitle', true)) {
echo '<div class="entry-subtitle">' . get_post_meta($page_for_posts, 'subtitle', true) . '</div>';
} ?>
</div>
</div>
<div class="container">
<div class="content-box content-single">
<?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(); ?>