2019-05-23 12:30:31 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The article template.
|
|
|
|
*
|
2021-07-09 15:43:11 -04:00
|
|
|
* @author Adam Piontek
|
2019-05-23 12:30:31 -04:00
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
|
2021-07-02 10:24:48 -04:00
|
|
|
namespace WP_73k;
|
2019-05-23 12:30:31 -04:00
|
|
|
|
|
|
|
?>
|
2021-08-04 16:40:42 -04:00
|
|
|
<article
|
|
|
|
id="post-<?php the_ID(); ?>"
|
|
|
|
class="<?php
|
|
|
|
$post_class = 'post border-bottom border-gray pb-4 mb-3';
|
|
|
|
echo esc_attr( implode( ' ', get_post_class( $post_class ) ) );
|
|
|
|
?>"
|
|
|
|
itemscope itemtype="https://schema.org/CreativeWork"
|
|
|
|
>
|
2021-07-06 15:31:46 -04:00
|
|
|
<header>
|
|
|
|
<h2 class="post-title fs-2 fw-600 mb-2">
|
|
|
|
<?php
|
2021-07-11 13:52:25 -04:00
|
|
|
if ( is_archive() || is_search() || is_home() ) {
|
2021-07-06 15:31:46 -04:00
|
|
|
printf( '<a href="%s" rel="bookmark">%s</a>',
|
|
|
|
esc_url( get_the_permalink() ),
|
|
|
|
esc_html( get_the_title() )
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
echo get_the_title();
|
|
|
|
} ?>
|
|
|
|
</h2>
|
|
|
|
|
2021-08-04 16:40:42 -04:00
|
|
|
<div class="post-date font-monospace text-muted <?php echo (has_tag() ? '' : 'mb-3'); ?>">
|
2021-07-09 12:20:38 -04:00
|
|
|
<?php
|
2021-07-26 11:03:32 -04:00
|
|
|
echo inline_svg( 'mdi-calendar-clock', array( 'div_class' => 'icon baseline me-2' ) ) . get_the_date('F j, Y');
|
|
|
|
echo ' by ' . inline_svg( 'mdi-account', array( 'div_class' => 'icon baseline me-1' ) ) . get_the_author();
|
2021-07-09 12:20:38 -04:00
|
|
|
?>
|
2021-07-06 23:31:20 -04:00
|
|
|
</div>
|
2021-07-06 15:31:46 -04:00
|
|
|
|
2021-07-06 23:31:20 -04:00
|
|
|
<?php
|
2021-07-07 15:40:18 -04:00
|
|
|
if (has_tag()) {
|
2021-07-10 10:42:28 -04:00
|
|
|
echo '<div class="post-tags fs-smaller mb-4">';
|
2021-08-04 16:40:42 -04:00
|
|
|
echo inline_svg( 'mdi-tag-multiple', array( 'div_class' => 'icon baseline text-muted me-1' ) );
|
2021-07-06 23:31:20 -04:00
|
|
|
|
|
|
|
$tag_strings = array_map(function ($tag) {
|
2021-08-04 16:40:42 -04:00
|
|
|
return '<span class="text-muted">#</span><a href="' . get_tag_link($tag) . '">' . $tag->name . '</a>';
|
2021-07-07 15:40:18 -04:00
|
|
|
}, get_the_tags());
|
|
|
|
|
2021-07-06 23:31:20 -04:00
|
|
|
echo implode(", ", $tag_strings) . '</div>';
|
|
|
|
}
|
|
|
|
?>
|
2019-05-23 12:30:31 -04:00
|
|
|
|
2021-07-04 18:16:33 -04:00
|
|
|
</header>
|
2019-05-23 12:30:31 -04:00
|
|
|
|
2021-07-06 23:31:20 -04:00
|
|
|
<div class="article post-body">
|
2021-07-04 18:16:33 -04:00
|
|
|
<?php
|
|
|
|
if ( has_post_thumbnail() ) {
|
|
|
|
echo get_the_post_thumbnail( get_the_ID(), 'large', ['class' => 'rounded shadow-lg'] );
|
|
|
|
}
|
2019-05-23 12:30:31 -04:00
|
|
|
|
2021-08-04 16:40:42 -04:00
|
|
|
the_content();
|
|
|
|
|
|
|
|
wp_link_pages(
|
|
|
|
array(
|
|
|
|
'before' => '<nav class="d-flex justify-content-center" aria-label="Page navigation for post ' . get_the_title() . '"><div class="d-flex align-items-center pe-2">Post pages:</div><div class="pagination">',
|
|
|
|
'after' => '</div></nav>',
|
|
|
|
'link_before' => '<span class="page-link">',
|
|
|
|
'link_after' => '</span>'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2021-07-04 18:16:33 -04:00
|
|
|
</div>
|
2019-05-23 12:30:31 -04:00
|
|
|
</article>
|