4 comments

  1. Posting the answer that was solved by OP in one of the comments. This way it’s easier to read it. Hopefully a moderator can mark the question as solved.

    .page-template-template-magazine-php .post-meta, .category-services .post-meta {
        display:none;
    }
    
  2. Assuming that you category is ‘services” then;

    .category-services .post-meta {
        display:none;
    }
    

    Or if using LESS

    .category-services {
         .post-meta {
             display:none;
         }
     }
    

    Each category is appended to the class structure of so if category is called ‘dog” it is appended as category-dog.

    In your case it is

    <article class="post-100 post type-post status-publish format-standard hentry category-services">
    
  3. You could also add in your category template file a code similar to this one:

    <?php if(is_category('category-slug-here') { ?>
        // display your HTML meta here
    <?php } ?>
    

    You would probably need to check for subcategories, but this should get you started if you want to take the PHP approach.

  4. $category = get_the_category(); 
    
    if ( $category[0]->cat_name == "featured" ) {
    
        // if first category in array is "featured", get next category in line
    
         $name = $category[1]->cat_name;
         $cat_id = get_cat_ID( $name );
         $link = get_category_link( $cat_id );
         echo '<a href="'. esc_url( $link ) .'"">'. $name .'</a>';
    
    } else {
    
        // get the first category
    
         $name = $category[0]->cat_name;
         $cat_id = get_cat_ID( $name );
         $link = get_category_link( $cat_id );
         echo '<a href="'. esc_url( $link ) .'"">'. $name .'</a>';
    
    }
    

Comments are closed.