WordPress.org

Ready to get started?Download WordPress

Forums

How do I programmatically change the body background image? (php) (2 posts)

  1. cynthia2012
    Member
    Posted 1 year ago #

    I'm using a child theme off of thematic, and haven't found anything that let's me alter the background image on <body> on the fly.

    I want to show a different background depending on whether the viewer is logged in or not.

    I know how to check for whether a user is logged in, but I can't figure out where I can change the background image for the body tag...what hook, if any?

    This isn't about setting a different image for a div, or for a particular page. So the background would be for all pages (default) but based on user logged in status.

    thanks!
    Cynthia

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    have you checked if the theme uses body_class() which would output a .logged-in css class if the user is logged in;

    you could use that in style.css to format different backgrounds.

Topic Closed

This topic has been closed to new replies.

About this Topic