WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to Hide a Specific Author Type? (Or Inactive) (1 post)

  1. anevaude
    Member
    Posted 3 years ago #

    I'm working with a project where there is a list of employees. I would like to be able to hide "Inactive" employees from appearing in the blog, but still keep their information in the CMS. What is the best way to do this?

    My first thought was to create a custom "Inactive" role and restrict that type from appearing. But I'm not sure what PHP I'd write to accomplish that.

    My second thought, that it already built out... is having a field within the User's "Bio" area in which I could check them as Active/Inactive. But I'm not sure what the code would be to connect after that:

    This is started:

    <input name="active" type="checkbox" value="true"
    <?php if (get_the_author_meta('active', $user->ID) == "true")
    { echo " checked"; };
    ?> />

    Thoughts?

Topic Closed

This topic has been closed to new replies.

About this Topic