Forums

Conditional for a Single Page with Specific Author ID? (1 post)

  1. doodlz
    Member
    Posted 1 year ago #

    On single post pages I would like the author's image/avatar to appear next to the post title. There are multiple authors on this blog. I'm using the Studiopress Genesis theme, so I attempting to hook the avatar before the post title in my functions file.

    I need a conditional that is something like this:

    // Add Author Avatar before Post Title
    add_action('genesis_before_post_title', 'include_author_avatar');
    function include_author_avatar() {
        if (is_single() && is_author('3')) {
          require(CHILD_DIR.'/author_avatar_3.php');
    }   elseif (is_single() && is_author('4')) {
          require(CHILD_DIR.'/author_avatar_4.php');
       }
    }

    But obviously that doesn't work because is_author isn't the correct tag. Is there a way to accomplish this?

Topic Closed

This topic has been closed to new replies.

About this Topic