Hide authors by id

Posted in: Newspaper
Post count: 2

Hi,

How can i hide some of the authors (sorted by id) from displaying on posts and homepage? Usually admins are posting and selecting authors for every post, but some posts don’t have “authors”, and current admin-name is being displayed. Thanks.

Post count: 23312

Hello jbabken,

Unfortunately, our theme does not have such an option to exclude the authors by ID, sorry! If you want to do this, you can only through code. First of all, you have to get the authors ID from the panel, like this -> http://screencast.com/t/iuXi7nqPtyV and then you have to add some conditions in td_module_single_base.php and td_module.php, like this -> http://screencast.com/t/dfUfjWyO0CVa -> http://screencast.com/t/ldMPPUnxm -> http://screencast.com/t/wuOJmSnw Also if you want more than one author ID, you have to use an array and put there all the ID’s and then you have to use in_array condition. For more information about how you can use in_array, please check this topic, here -> https://forum.tagdiv.com/search/in_array+%40andrei/ and this -> http://php.net/manual/ro/function.in-array.php
Please notice that you want to display more levels in our theme and you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry!

Thank you for your understanding!

Post count: 2

Thanks a lot Catalin,

It works like a charm. Just another question, where should i look if i want to hide the authors name from being displayed, by role? For example, hide names in all posts, posted by editor user role? Thanks again.

Post count: 23312

Hello jbabken,

Please notice that you have to add a check condition to know the capabilities of your user. For more references about these, please check here -> https://codex.wordpress.org/Roles_and_Capabilities If you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry!

Thank you for your understanding!

Post count: 64

Hi,
Ive got to manage to hide ONE AUTHOR by ID, but cant find how to put the array in there to hide two authors by ids, can anyone quickly help here? Would be much appreciated!!

Post count: 64

When I put it in array like this code below, it hides ALL AUTHORS! Any idea?

if ( $this->post->post_author = array(‘3′,’5’)){
return;
}

Post count: 23312

Hello kognitoweb,

Replied via another topic.

Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.