blog listing initially working

This commit is contained in:
Adam Piontek 2021-07-06 23:31:20 -04:00
parent 3c6d3e6894
commit 71c26a5f29
7 changed files with 131 additions and 29 deletions
content-templates

View file

@ -22,28 +22,29 @@ namespace WP_73k;
echo get_the_title();
} ?>
</h2>
</header>
</article>
<?php $posttags = get_the_tags(); ?>
<div class="post-date font-monospace text-gray-300 <?php if (count($posttags) == 0) { echo 'mb-3'; } ?>">
<?php echo svg_icon_use("mdi-calendar-clock", "icon baseline me-2") . get_the_date('F j, Y'); ?>
by <?php echo svg_icon_use("mdi-account", "icon baseline me-1") . get_the_author(); ?>
</div>
<article <?php post_class( 'bg-white border-2 border-gray-400 p-8' ); ?> itemscope itemtype="https://schema.org/CreativeWork">
<header>
<h2 class="m-0">
<?php
<?php
if (count($posttags) > 0) {
echo '<div class="post-tags fs-smaller mb-4">' . 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;
}, $posttags);
echo implode(", ", $tag_strings) . '</div>';
}
?>
if ( is_archive() || is_home() ) {
printf( '<a href="%s" rel="bookmark">%s</a>',
esc_url( get_the_permalink() ),
esc_html( get_the_title() )
);
} else {
echo get_the_title();
} ?>
</h2>
<p class="text-sm">Published on <?= get_the_date(); ?></p>
</header>
<div class="article">
<div class="article post-body">
<?php
if ( has_post_thumbnail() ) {
echo get_the_post_thumbnail( get_the_ID(), 'large', ['class' => 'rounded shadow-lg'] );
@ -51,8 +52,4 @@ namespace WP_73k;
the_content(); ?>
</div>
<footer>
Categorized under: <?= get_the_category_list( ',' ); ?>
</footer>
</article>