Support » Themes and Templates » Different post styles for different authors?

  • Resolved ladydelaluna


    Has anyone been able to do this? For example, my posts and pages have a lavender background with purple links and my other admin’s posts and pages have a melon colored bg with orange links?

    I’m sure it’s going to have to rely on CSS div styles and such, but I’m looking for maybe some PHP “if/else” stuff that can be modified per author in order to pull in certain div styles (ex. my posts “content1” her posts “content2”)?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The simplest would be <div class="postby<?php the_author(); ?>"> and style accordingly.

    so then the styles would be





    but isn’t there a need for some sort of “if/else” in there?

    There should be no need for if/else’s. The code will just print <div class="postbyme"> or <div class="postbyher"> The only place it might break down is if you then add a third author without adding some CSS too.
    And it might be
    .postbyme etc.. I always get my # and .’s mixed up.

    nope – you’re right. “.” for class “#” for id 🙂

    thank you!
    i’ll let you know when we get the site up if this works… 😀

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different post styles for different authors?’ is closed to new replies.