Hi there,
I have enabled author box in posts settings, but I want the posts from just 1 author not to show the author box.
In my previous theme I have used a conditional tag to do this but I don’t know where to add the code.
Here is the code that i used in single.php:
before the authorbox div element:
<?php define (‘author_x’, ‘author no’);
$author_id = get_the_author_ID(); ?>
<?php if ( $author_id != author_x ) { ?>
And after the authorbox div element:
<?php } ?>
Can you please tell me where to add the code or what else to do in order to do it?
Regards
Hello,
to hide the box for the author with id 1 http://screencast.com/t/upbichKQD
to hide the box for multiple authors: http://screencast.com/t/6T4yVnkHf
@rcraig232 I will add classes to them in the next update. To make it easier to hide the boxes via css. Until then, the method from above will work for you?
Hi,
Use the if condition here from V3 http://screencast.com/t/ifEA6PxJ
Thanks!
Hi,
Replace this line http://screencast.com/t/A4hd7Y2h7K with this code:
<?php
if (
$td_mod_single->post->post_author != 1 and
$td_mod_single->post->post_author != 2 and
$td_mod_single->post->post_author != 4 and
$td_mod_single->post->post_author != 7
) {
echo $td_mod_single->get_author_box();
}
?>
That code will hide the author with ID 1, 2, 4 and 7
