Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1149210

    I would like to know how to add title with name of category on the page category archive.

    Just need to add the category name at the top of the page – i’m using Grid Layout in Blog Layout — Enfold Blog Layout conf, and the title doesn’t appear.

    I activated the bar with the title and breadcrumbs, but that’s not what I want. I want the title (with category name) at the top of the page.

    tks,
    Junior Brambilla

    #1149609

    Hey Junior,

    Could you please attach a mockup of what you’re trying to achieve?

    Best regards,
    Victoria

    #1149901

    Hey Victoria,

    See link: https://www.dropbox.com/s/pftqgt6owww5gtq/category.jpg?dl=0

    I want add title (h1 – exemple) with category name … now show only description of category, no title … ok

    Tks,
    Junior

    #1150926

    Hi,

    Thanks for the update.

    You can modify the archive.php file. If you have a child theme, just create a copy of the file in the child theme directory. Look for the term or category description around line 34:

    <?php 
    
    						$tds =  term_description(); 
    						if($tds)
    						{
    							echo "
    <div class='category-term-description'>{$tds}</div>
    ";
    						}
    					?>
    

    Below, you can add this code to render the category title:

    <?php single_cat_title('Currently browsing '); ?>.
    
    

    More info in the documentation.

    // https://developer.wordpress.org/reference/functions/single_cat_title/

    Best regards,
    Ismael

    #1150931

    Hi, Ismael

    The file already has the code you sent. And it’s not working … it doesn’t show the title at the top of the page.

    Tks,
    Junior

    #1151167

    Hi,

    Thank you for the update.

    We may need to access the site in order to see what’s going on. Please post the WP login details in the private field, and make sure that the Appearance > Editor panel is accessible so that we can edit the files if necessary.

    Best regards,
    Ismael

    #1151169

    Ok!!!

    #1151752

    Hi,

    Thank you for the update.

    We modified the archive.php file and added the single_cat_title function as suggested previously. We added the category title above the category description instead. The prefix “Currently browsing:” can be removed whenever you want.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.