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

  1. cynthia2012
    Posted 3 years 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.


  2. Michael
    Forum Moderator
    Posted 3 years 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