0

I now you can hide the entry-header using css but what if I want just to hide it for a specific category?

<div class="entry-header">
    <div class="entry-meta category-meta">
        <div class="cat-links"><a href="https://web.com/category/mycategory/" rel="category tag">Auspiciadores</a></div>
    </div><!-- .entry-meta -->
    <h2 class="entry-title"><a href="https://web.com/2020/02/06/entry-two/">My Category</a></h2>        
    <div class="entry-meta">
        <div class="date"><a href="https://web.com/2020/02/06/entry-two/" title="Entry Two">6 february 2020</a> </div> 
        <div class="by-author vcard author"><a href="https://entry-two/author/somebody/">Somebody</a> </div>                                                                
    </div>
</div>

I want to aply something like the following css but just for an especific category:

.entry-header {
    display:none;
}

EDIT:

Can I accomplish this writing in functions.php something like this:

function prefix_category_title( $title ) {
    if ( is_category( 'auspiciadores' ) ) {
        $title = single_cat_title( '', false );
    }
    return $title;
}
add_action( 'get_the_archive_title', 'prefix_category_title' );
  • if your theme uses body_class() and/or post_class() you should have specific selectors to use for CSS. Formatting questions are off-topic here in the forum. Please consider asking the developer of your theme. – Michael Feb 12 at 4:33
0

You can try :

body.category-uncategorized .entry-header {
    display:none;
}

"uncategorized" Should be your category slug. This is for the post category only. If you have a custom registered category then you can check the element. There you should get your category name.

This is what for WooCommerce category: enter image description here

So you should use like this for WooCommerce "accessories" Category:

body.term-accessories .entry-header {
    display:none;
}

Hope this will help.

|improve this answer|||||
0

I edited the section that writes the information od the post:

if ( is_category( 'mycategory' ) ) { the_title( '' ); } else { the_title( '', '' ); } ?> ', '' ); ?> if ( is_category( 'mycategory' ) ) { //nothing } else { newscard_posted_on(); } ?>

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.