• Resolved Joseph

    (@xmsmmgrs)


    Hello!

    How can I display the category and tag when on a category or tag page?

    For instance, when I click on a specific category, there is the list of the posts under that category, but the page has no title. The title should be the name of that category.

    Thanks!

    • This topic was modified 4 years, 6 months ago by Joseph.
    • This topic was modified 4 years, 6 months ago by Joseph.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Joseph

    (@xmsmmgrs)

    I found the problem by myself.

    This is templates/grid/category-description.php

    <?php
    
    $categories = get_category( get_query_var( 'cat' ) );
    $category_name = $categories->name;
    $category_description = $categories->category_description;
    
    if ( !empty( $category_description ) ) : ?>
    <div class="category-description">  
    
    	<h4><?php echo esc_html( $category_name ); ?></h4>
    	<p><?php echo ''. $category_description; ?></p>
    
    </div>
    <?php endif; ?>

    The category name should be displayed even if there is no description to it.

    Hi @xmsmmgrs

    At first, sorry for the late reply, we had holidays.

    I will redirect this topic to the developer’s board and they will check.

    Kind Regards

    Theme Author WP Royal

    (@wproyal)

    Hi Joseph,

    You can display a Category name by removing the “if ( !empty( $category_description ) )” statement line, guess you already know, just for others reading this thread. You are right, it’s necessary for SEO and will be fixed in the next update.

    Kind Regards

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Category name not shown on the category page’ is closed to new replies.