The MU forums have moved to WordPress.org

Via $post_author: Custom template header for individual users? (4 posts)

  1. kreuzian
    Member
    Posted 15 years ago #

    I am hoping to basically have a system so that if the user posting the post is say, Joe, it will display Joe's image in the header. If the post is from Sally, it displays Sally's image.

    <?php if ($post_author = 'admin') {
    echo 'joes image here';
    }
    ?>

    Not sure how to code it exactly. It does say the message with that code oddly, however it doesn't matter WHAT author I put there, and it appears on every single post. Basically, how can I make it only appear on Joe's posts?

  2. andrea_r
    Moderator
    Posted 15 years ago #

    Why not just use an author avatar in the post?

    What happens on the index or archive pages when there are multiple posts by multiple authors?

  3. kingkong954
    Member
    Posted 15 years ago #

    Are you pulling this info while inside the loop? Maybe that's having an issue?

  4. kreuzian
    Member
    Posted 15 years ago #

    kingkong, I don't think that's the case.

    Also, author avatar is not what I'm talking about. I'm talking about being able to change banners in the header, or advertisements on the sides, to special ones specific to each user/author's posts.

About this Topic

  • Started 15 years ago by kreuzian
  • Latest reply from kreuzian