feat(blog): add page title and trim post card to image + title + byline
This commit is contained in:
@@ -23,6 +23,8 @@ get_header();
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<div class="blog-posts <?php echo esc_attr( $clsEntry ); ?>">
|
||||
<div class="post-list">
|
||||
<h1 class="post-list__h1">Blog</h1>
|
||||
|
||||
<div class="post-list__posts grid grid-cols-[repeat(auto-fit,minmax(20rem,1fr))] gap-6">
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
@@ -41,26 +43,11 @@ get_header();
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
|
||||
<div class="post-list__details px-4 py-8 flex flex-col grow">
|
||||
<div class="post-list__cats">
|
||||
Posted in:
|
||||
<?php
|
||||
$categories = get_the_category();
|
||||
foreach ( $categories as $index => $category ) :
|
||||
$separator = $index < count( $categories ) - 1 ? ', ' : '';
|
||||
?>
|
||||
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>" class="post-list__category text-14px font-semibold leading-none uppercase mt-0 mb-2.5 mx-0 inline-block"><?php echo esc_html( $category->name ); ?></a><?php echo esc_attr( $separator ); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<div class="post-list__details px-4 py-6 flex flex-col grow">
|
||||
<a href="<?php the_permalink(); ?>" class="">
|
||||
<h2 class="post-list__title font-normal text-25px text-balance line-clamp-4 truncate mt-0 mb-5 mx-0"><?php the_title(); ?></h2>
|
||||
</a>
|
||||
|
||||
<div class="post-list__excerpt mb-6">
|
||||
<?php customExcerpt( get_the_content(), 15 ); ?>
|
||||
</div>
|
||||
|
||||
<div class="post-list__byline mt-auto">
|
||||
<span class="post-list__author"><?php echo esc_html( ucfirst( get_the_author() ) ); ?> —</span>
|
||||
<span class="post-list__date"><?php echo get_the_date(); ?></span>
|
||||
|
||||
Reference in New Issue
Block a user