Author Box, show in specific posts or category

Posted in: Newspaper
Post count: 9

Is it possible to show the author box only in specific posts or at least in specific categories?
I have found the way only to enable/disable it from the whole site.

Post count: 22421

Hello,
The author box can be customized to show up in specific categories only by adding conditions in the code. The author box is added in the loop-single files: http://screencast.com/t/JWt5mX6pn If you have the proper skills, you can use this condition to make the author box show up only on your preferred categories: https://developer.wordpress.org/reference/functions/in_category/
Thank you!

Post count: 9

hm… i can try this, but is there a way to show author box ONLY for specific authors?
In another topic you mentioned this code

<?php if ( ! is_admin() ){
echo $td_mod_single->get_author();
}?>

which is whowing the author if he is the admin?
can we do the opposite, and show only authors which are not admin?

Post count: 22421

Hi,

You can use the condition in the author box as well. You can use it like so:

<?php
if (!current_user_can( 'activate_plugins' )) {
echo $td_mod_single->get_author_box();
}?>

Ad replace this code for the post style that you use: http://screencast.com/t/YLDArknZ
This will make the author box not show up for admin users.

Thank you!

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