I use this code to add custom CSS if single post and in certain categories:
function hide_author() {
global $post;
if (is_single($post->ID) && in_category(array( 'category 1', 'Category 2'), $post->ID)) {
?>
<style type="text/css">
.author-info {display: none;}
</style>
<?php
}
}
add_action('wp_head', 'hide_author');
I was wondering how to fire wp_head action if single post by certain users (either by user ID or username)? Can I use wp_set_current_user ()? if so, how to use it exactly?
Thanks,