How to display category names on the Blog Page(Post Page)
Question
Hi everyone I hope your doing well, I’m having trouble on how to display the category names on the Post Page or my Blog Page, could anyone give me an idea on how to display the category names.
Here’s how it should look like (the red rectangle is the category names):
Here’s my loop:
<!-- Blog -->
<div class="common_wrapper">
<div class="wrapper_100">
<?php
$current_month = null;
while ( have_posts() ) : the_post();
$this_year = get_the_date( 'Y' );
if ( $this_year !== $current_year ) {
echo '<h2>' . $this_year . '</h2>';
}
$current_year = $this_year;?>
<a href="<?php echo get_permalink(); ?>">
<?php the_date('Y/m/d')?>
<?php the_content()?>
</a>
<?php endwhile;?>
</div>
</div>
Thank You
0
2 months
0 Answers
9 views
0
Leave an answer
You must login or register to add a new answer .