-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
97 lines (96 loc) · 4.08 KB
/
archive.php
File metadata and controls
97 lines (96 loc) · 4.08 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php get_header(); ?>
<div class="page"
style="background-image: linear-gradient(rgba(2, 8, 21, 0.9), rgba(2, 8, 21, 0.8)), url(<?php echo esc_url(get_theme_mod('background_image_setting', get_template_directory_uri() . '/assets/img/banner1.jpg')); ?>)">
<div class="page__header">
<h1 class="page__title animate__animated animate__zoomIn">
<?php
if (is_category()) {
single_cat_title();
$cat_id = get_query_var('cat');
$link = get_category_link($cat_id);
}
elseif (is_tag()) {
single_tag_title();
$tag_id = get_query_var('tag_id');
$link = get_tag_link($tag_id);
}
elseif (is_author()) {
the_post();
$author_id = get_the_author_meta('ID');
$link = get_author_posts_url($author_id);
echo 'Author Posts: ' . get_the_author();
rewind_posts();
}
elseif (is_day()) {
echo 'Daily Posts: ' . get_the_date();
$link = get_site_url();
}
elseif (is_month()) {
echo 'Monthly Posts: ' . get_the_date(_x('F Y', 'monthly archives date format', 'gcinigeria-wp'));
$link = get_site_url();
}
elseif (is_year()) {
echo 'Yearly Posts: ' . get_the_date(_x('Y', 'yearly archives date format', 'gcinigeria-wp'));
$link = get_site_url();
}
else {
$title = post_type_archive_title('', false);
$link = get_site_url() . '/' . strtolower($title);
echo $title;
}
?>
</h1>
</div>
<p class="page__share">Share this</p>
<div class="page__icons">
<a href="https://www.facebook.com/sharer/sharer.php?u=<?= esc_url($link) ?>" class="page__icon"
target="_blank"><i class="bi bi-facebook"></i></a>
<a href="http://www.twitter.com/share?url=<?= esc_url($link) ?>" class="page__icon" target="_blank"><i
class="bi bi-twitter-x"></i></a>
<a href="whatsapp://send?text=<?= esc_url($link) ?>" class="page__icon" target="_blank"><i
class="bi bi-whatsapp"></i></a>
<a href="https://telegram.me/share/url?url=<?= esc_url($link) ?>" class="page__icon" target="_blank"><i
class="bi bi-telegram"></i></a>
</div>
</div>
<section class="section">
<div class="section__content">
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
?>
<article class="section__card" id="post-<?php the_ID(); ?>">
<?php if (has_post_thumbnail()) : ?>
<?php the_post_thumbnail('thumbnail'); ?>
<?php else : ?>
<img src="<?php echo get_template_directory_uri() ?>/screenshot.png" alt="<?php the_title(); ?>"
class="section__card-img">
<?php endif; ?>
<h5 class="section__card-title"><?php the_title(); ?></h5>
<div class="section__card-text"><?php the_excerpt(); ?></div>
<a href="<?php the_permalink(); ?>" class="btn btn__outline-gold">Read more</a>
</article>
<?php
endwhile;
else : ?>
<div class="not-found">
<p class="not-found__text">Sorry, no posts were found!</p>
</div>
<?php
endif;
?>
</div>
</section>
<section class="section" style="margin-top:-10rem">
<div class="article__content">
<?php
the_posts_pagination(array(
'mid_size' => 2,
'prev_text' => __('← Previous', 'gcinigeria-wp'),
'next_text' => __('Next →', 'gcinigeria-wp'),
));
?>
</div>
</section>
<?php get_footer(); ?>