add main posts pagination, fix tag links

This commit is contained in:
Adam Piontek 2021-07-10 10:42:28 -04:00
parent 5247cb5331
commit 2ac3f742b5
2 changed files with 11 additions and 4 deletions

View file

@ -32,12 +32,11 @@ namespace WP_73k;
<?php
if (has_tag()) {
echo '<div class="post-tags fs-smaller mb-4">' . svg_icon_use("mdi-tag-multiple", "icon baseline text-gray-300 me-1");
echo '<div class="post-tags fs-smaller mb-4">';
echo svg_icon_use("mdi-tag-multiple", "icon baseline text-gray-300 me-1");
$tag_strings = array_map(function ($tag) {
$tag_str = '<span class="text-gray-300">#</span>';
$tag_str .= '<a href="' . get_bloginfo('url') . '/tag/' . $tag->slug . '">' . $tag->name . '</a>';
return $tag_str;
return '<span class="text-gray-300">#</span><a href="' . get_tag_link($tag) . '">' . $tag->name . '</a>';
}, get_the_tags());
echo implode(", ", $tag_strings) . '</div>';

View file

@ -18,6 +18,14 @@ get_header(); ?>
the_post();
echo get_template_part( 'content-templates/content', 'article' );
}
?>
<nav class="d-flex justify-content-between" aria-label="Page navigation">
<div class="nav-previous alignleft"><?php next_posts_link( '&larr; Older' ); ?></div>
<div class="nav-next alignright"><?php previous_posts_link( 'Newer &rarr;' ); ?></div>
</nav>
<?php
}
?>