TransWikia.com

How to display category names on the Blog Page(Post Page)

WordPress Development Asked by jricc russel on December 20, 2020

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):
enter image description here

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

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP