How to hide the author card inside the posts of a specific user (at once)

Posted in: Newspaper
Post count: 18

Hi.
I want to hide the author box from posts that are made from the user ‘news room’ (eg, with user id = 10 ). I don’t want to hide it in specific posts with css, but rather target all posts of that user, past, present, and future.

I have located in the file loop-single.php (and loop-single-1.php loop-single-2.php etc) the line:

<?php echo $td_mod_single->get_author_box();?>

I suspect I have to wrap an if statement around this line, something like that:


<?php if ( .... ) { ?>  //author id is not equal to 10, display the author card
    <?php echo $td_mod_single->get_author_box();?> 
<?php } ?>

how do i do this the correct way? what shall i put in this if statement?

Post count: 22421

Hello,

You can use this code like so:
<?php
if ($td_mod_single->post->post_author != 10){
echo $td_mod_single->get_author_box();}
?>

Thank you!

Post count: 18

Yes! That’s what I was looking for, thank you. 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.