-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
78 lines (73 loc) · 2.56 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
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
<?php
/**
* Archive template
*/
get_header();
$archive_details = npub_current_archive_details();
?>
<div class="container">
<div class="row">
<div class="col">
<blockquote class="block-heading"><h1><?php echo esc_html(
$archive_details['title']
); ?></h1>
<?php if (!empty($archive_details['description'])) {
echo sprintf(
'<cite>For: %s</cite>',
esc_html($archive_details['description'])
);
} ?>
</blockquote>
<div class="container px-2 latest-nbolck npub-big-title category-section npub-full-row">
<?php if (have_posts()):
while (have_posts()):
the_post();
$post_image = get_the_post_thumbnail(get_the_ID(), '', [
'loading' => 'lazy',
'class' => 'one-col-article-img wp-post-image',
]);
$post_cats = get_the_category_list(' , ', '', get_the_ID());
$post_title = get_the_title();
$author_id = get_post_field('post_author', get_the_ID());
?>
<div class="row one-col-article p-2 my-1 px-sm-2 py-sm-2 my-sm-1 py-md-3 px-lg-2 px-md-3 my-md-1 py-lg-2 px-xl-2 py-xl-2 my-lg-3 d-flex align-items-lg-center align-items-md-top align-items-sm-start align-items-start check-in-view">
<div class="col-lg-4 col-md-5 col-sm-4 col-5 m-0 px-sm-2 px-md-1 pt-lg-2 px-lg-2 p-2 pt-md-0 ps-1">
<a href="<?php echo esc_url(get_permalink()); ?>">
<span class="size-npub-medium"><?php echo $post_image; ?></span>
</a>
</div>
<div class="col-lg-7 col-md-7 col-sm-8 col-7 p-0 ps-lg-2 ps-md-3 ps-2 ps-sm-2 pt-xs-2 pt-sm-0">
<?php
if (!empty($post_cats)) { ?>
<span class="npub-link pe-2"><?php echo wp_kses_post($post_cats); ?></span>
<p class="d-inline pe-2 npub-secondary-color npub-secondary-title"><?php echo esc_html(
get_the_author_meta('display_name', $author_id)
); ?></p>
<p class="d-inline p-0 npub-secondary-color npub-secondary-title"> <?php echo esc_html(
npub_time_ago()
); ?></p>
<?php }
if (!empty($post_title)) { ?>
<a href="<?php echo esc_url(get_permalink()); ?>">
<h4><?php echo esc_html($post_title); ?></h4>
</a>
<?php }
?>
<p class="full-width-1col-exerpt my-0 my-md-2 npub-text-color npub-blog-detail"><?php echo wp_kses_post(
substr(get_the_excerpt(), 0, 150)
); ?></p>
</div>
</div>
<?php
endwhile;
echo wp_kses_post(paginate_links());
else:
?>
<div class="nblocks-notfound">No posts are found..!</div>
<?php
endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>