• Hello WP forum,

    I am a PHP developer. Here’s my client’s blog:
    https://www.sohopress.com/blog/

    Any post in a certain category I’ve made is displayed on the front page.
    The “author blogs” section is set up (with PHP) so that it pulls each unique author and links to them IF
    1. they have at least 1 post
    2. if they are NOT from a custom set of user ids

    The custom set of user ids consists of the user ids for the staff at sohopress.com. You see a post from “mark” on the blog… he doesn’t have a link under “author blogs” because he’s in that set.

    Now I want to make it so that if the post is from that set of people, the author will display as “Soho Press” rather than the staff member’s name… it should be SO EASY but how to do it within wordpress… basically this:

    if (author id is from a given set){
    echo “Soho Press”;
    } else {
    echo $author_name;
    }

    How do I access this in the loop? Is there some way for me to pull out the variables so I can use them in standard-type PHP code?

    Thanks,
    Jacob

  • The topic ‘Using your own PHP code in WordPress’ is closed to new replies.