✨feature: Style single post template
This commit is contained in:
+16
-38
@@ -27,52 +27,30 @@ if ( hasSidebar() ) {
|
||||
the_post();
|
||||
?>
|
||||
|
||||
<div class="post-img">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<img src="<?php the_post_thumbnail_url( 'full' ); ?>" alt="<?php the_title(); ?>" class="w-full h-auto mb-6">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="post-title mb-0">
|
||||
<h1 class="mb-0"><?php the_title(); ?></h1>
|
||||
<h1 class=""><?php the_title(); ?></h1>
|
||||
|
||||
<div class="post-subtitle text-28px font-quincy font-bold m-0 mb-6 p-0 leading-none text-cwc-blue-02">
|
||||
<?php the_field( 'subtitle' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="post-meta text-14px italic mb-6">
|
||||
<div class="post-meta text-14px text-cwc-orange-01 uppercase font-bold mb-6">
|
||||
<div class="">
|
||||
<span class="post-date">Posted: <?php the_date(); ?></span> | <span class="post-author">Posted by: <?php echo esc_html( ucfirst( get_the_author() ) ); ?></span>
|
||||
</div>
|
||||
|
||||
<div class="">
|
||||
<span class="post-categories">
|
||||
<?php
|
||||
$categories = get_the_category();
|
||||
if ( ! empty( $categories ) ) {
|
||||
echo '<span>Posted in: ';
|
||||
foreach ( $categories as $ct ) {
|
||||
echo '<a href="' . esc_url( get_category_link( $ct->cat_ID ) ) . '">' . esc_html( $ct->name ) . '</a>';
|
||||
if ( count( $categories ) > 1 && $ct !== end( $categories ) ) {
|
||||
echo ', ';
|
||||
}
|
||||
}
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
|
|
||||
<span class="post-tags">
|
||||
<?php
|
||||
$tags = get_the_tags();
|
||||
if ( ! empty( $tags ) ) {
|
||||
echo '<span>Tagged: ';
|
||||
foreach ( $tags as $tg ) {
|
||||
echo '<a href="' . esc_url( get_tag_link( $tg->term_id ) ) . '">' . esc_html( $tg->name ) . '</a>';
|
||||
if ( count( $tags ) > 1 && $tg !== end( $tags ) ) {
|
||||
echo ', ';
|
||||
}
|
||||
}
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
the_content();
|
||||
<div class="post-content font-light">
|
||||
<?php the_content(); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user