• Resolved alursru

    (@alursru)


    Hello!

    I would like to remove the category heading.

    It should be displayed like this: News

    not Category: News

    So I just want the title alone without the word category:
    I would be glad if you helped me

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author Guido

    (@guido07111975)

    Hi,

    For that you should open file archive and look for:

    
    the_archive_title( 'the_archive_title( '<h1 class="page-title">', '</h1>' );
    

    Replace with (not tested yet):

    
    echo '<h1 class="page-title">'.single_cat_title().'</h1>';
    

    But I recommend using a child theme for changes like this, in case theme gets an update.

    Guido

    Thread Starter alursru

    (@alursru)

    Hi Guido thank you for your quick help!That works great!

    Only: now the category title is no longer h1 – The title is in the source code outside the h1 tag – (within content) and so I can not reach the CSS to adapt…
    Is there still a possibility?

    Theme Author Guido

    (@guido07111975)

    Hi,

    Of course, my mistake. Guess this should work:

    
    <h1 class="page-title"><?php single_cat_title(); ?></h1>
    

    (I’m not able to test this because using an iPad right now)

    Guido

    Thread Starter alursru

    (@alursru)

    thank you for your effort. unfortunately that brings a php error message

    Theme Author Guido

    (@guido07111975)

    Will be home in 2 days. Please wait till then and I will give you a proper fix!

    Guido

    Theme Author Guido

    (@guido07111975)

    Hi again,

    It turns out to be less simple as I thought.

    Remove this:

    
    		<?php
    			the_archive_title( '<h1 class="page-title">', '</h1>' );
    			the_archive_description( '<div class="archive-description">', '</div>' );
    		?>
    

    Replace with this:

    
    		<?php if ( is_category() ) : ?>
    			<h1 class="page-title"><?php single_cat_title(); ?></h1>
    		<?php else: ?>
    			<?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
    		<?php endif; ?>
    		<?php the_archive_description( '<div class="archive-description">', '</div>' ); ?>
    

    Guido

    Thread Starter alursru

    (@alursru)

    Thank You very much! This works wonderfully!!!! You are grat!

    Theme Author Guido

    (@guido07111975)

    Great, you’re welcome!

    Guido

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘remove Category title’ is closed to new replies.