Disable Author-box for a selective author

Posted in: Newsmag
Post count: 23

How can I completely disable the author-box only for a selective author, i.e., while I want to show author-box generally but want to disable display of author-box of a selective author on all his posts. Let us the selective author is “xyz”.

I understand that it can be done using Custom CSS “display:none” command, but what exactly to use for the author “xyz”?

Post count: 9544

You would likely need to edit the query for the author box element with an if user 123 based on the user id number, then dont show box, else show box.

Tagdiv should be able to point you at right file with screen shot and some example code to try, when they get back in monday.

Post count: 6535

Hi

To remove the author box from posts written by a specific author you need to add a condition in td_module_single_base.php file like here: http://screencast.com/t/AOLLk9j3A

if ($author_id == 3){
return;
}

If you want to remove author name from article top add this condition in td_module_single_base.php file here: http://screencast.com/t/rzD39z79MEPGhttp://screencast.com/t/hxs4uMhoo1Y

if (($this->post->post_author) == 3){
return;
}

To get the author id follow this link: http://screencast.com/t/5kY7lLtFB1MThttp://screencast.com/t/vO2XeRsO4HK7

Let me know how it goes!

Thanks!

Post count: 23

Thanks, Chris S, for your suggestion.

Thanks, Andrei L., for the solution suggested by you. It worked perfectly well. Thanks for your support.

Post count: 31

Hi Andrei,

I need to remove author name from all posts. I’ve tried to add the following code in td_module_single_base.php in the place shown in your screenshot (lines 69-71):

if (($this->post->post_author) == 3){
return;
}

However, it didn’t change anything.

Maybe it has to do with getting the author ID you mentioned, but this part was completely unclear to me. First, I couldn’t find the code mentioned. Also, is this supposed to be related to a specific author, because I want to remove all of them?

Thanks

Post count: 23

chauffeur,

If you want to disable author-box for all authors on posts, then there is a much simpler solution without editing the theme-code files.

On the admin side of your WordPress, click “Theme Panel” and then select “Post Settings”. Then, from the details that appear, again select “Post Settings” from the right-pane. There is an option called “Show Author Bpx”. Simply, unselect this option and the author Box will not be shown on all posts.

Post count: 31

That’s so obvious… now that I know. I’ve been looking for this, but not close enough it seems.

Thanks a lot for your help.

Post count: 6535

Hi


@chauffeur
the code I provided remove the author name only from posts written by the author with id=3. If you want to remove the author name from all posts you can use the theme option as @tilakmarg suggested.

Thanks!

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