Title: Hide Post Author &amp; Date &#8211; specific issue&#8230;
Last modified: August 20, 2016

---

# Hide Post Author & Date – specific issue…

 *  Resolved [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/)
 * Hello,
 * I am trying to get WordPress to hide author, date, and the “bookmark the permalink”–
   but ONLY in posts of a certain category. I know how to do a universal site-side
   change of this, but I don’t want to hide this data from other blog posts and 
   categories, just a particular category.
 * Is this possible? Can you please tell me what code I’d need to adjust for this?
   Thank you so much. I can’t complete my job here unless I solve this…

Viewing 15 replies - 1 through 15 (of 49 total)

1 [2](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/2/?output_format=md)

 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987404)
 * you would have to make a conditional logic function something like
 * if(is_category(id1,id2, id3)
    { hide info }
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987407)
 * Assuming I knew the category ID (which I know how to find), what file would I
   enter that code into? If it’s just one category and not all pages/posts…
 * Also, when you write “hide info”, what actually goes in between the {} in that
   example? Like, “entry-author” ? I’m a bit confused.
 * Thank you so much for trying to help me, you’re a true lifesaver.
 * How should I proceed?
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987408)
 * it will go into your functions.php file (preference would be if you create a 
   child theme and not modify the core files)
 * i usually do for hide info thing is use css
    <?php if (is_category(‘id’)) { echo‘
   <style> #author {display:none;} #time {display:none;} </style>’; } ?>
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987409)
 * Thank you Robin, I will try that code and mess around with it. If this works,
   I’ll hurry back and let you know that you saved the day.
 * I wish I was a guru like so many people here are 🙂
 * Thanks again,
    Ben
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987411)
 * cheers
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987422)
 * Hmm…is there a particular location in the functions file that this code should
   go in? Like, between other code, or at the very end, or etc.
 * Thank you!
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987423)
 * i put my code on top
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987435)
 * Well, no matter where I seem to place it in the php file, I get this sort of 
   error:
 * Parse error: syntax error, unexpected ‘<‘
 * I’m copying your code exactly, so perhaps I’m putting it in the middle of some
   code I should not be breaking up?
 * Is there a surefire way to know where I can put it where it will be safe and 
   work correctly?
 * Thank you!
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987437)
 * my code was just a reference guide
    and if you are getting this error means you
   are not closing your tags properly or missing a bracket and if you put it on 
   top under your <?php ?> it should not break
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987438)
 * Ah, yes ok – I thought I maybe forgot to close off the PHP with ?> or something–
   but it looked right.
 * I’ll try and put it at the top under the <?php ?> – thanks again!
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987440)
 *     ```
       <?php
       if ( is_user_logged_in()  )
         {
          echo ' <style>
   
       	</style>';
       } else {
   
       	echo ' <style>
   
       	html {
           background-color:#FFF !important;
       }
   
       	</style>' ;
       }
       ?>
       ```
   
 * this is my working code
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987442)
 * …? You lost me… 🙂
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987444)
 * i mean if you follow the structure of my code it should work , as this is the
   code i am using in one of my sites
 *  [Robin](https://wordpress.org/support/users/cinghaman/)
 * (@cinghaman)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987446)
 * [http://codex.wordpress.org/Conditional_Tags](http://codex.wordpress.org/Conditional_Tags)
 *  Thread Starter [thescarletfire](https://wordpress.org/support/users/thescarletfire/)
 * (@thescarletfire)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/#post-2987447)
 * Ah, yes – good news. The code no longer has a syntax error, but it doesn’t hide
   any data – so maybe the CSS does not match?
 * if (is_category(’23’))
    { echo ‘ <style> #author {display:none;} #time {display:
   none;} </style>’;
 * This doesn’t return an error but the author and time are still showing up in 
   that category for posts.
 * Hmmm…any ideas? You seriously are saving my tail here…

Viewing 15 replies - 1 through 15 (of 49 total)

1 [2](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/3/?output_format=md)
[4](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/4/?output_format=md)
[→](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/2/?output_format=md)

The topic ‘Hide Post Author & Date – specific issue…’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 49 replies
 * 2 participants
 * Last reply from: [Robin](https://wordpress.org/support/users/cinghaman/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/hide-post-author-date-specific-issue/page/4/#post-2987546)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
