• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Random background image for div elements

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Random background image for div elements

This topic is: not resolved

Tagged: background image

  • This topic has 5 replies, 2 voices, and was last updated 8 years, 12 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • May 22, 2016 at 10:17 pm #186114
    wasanajones
    Member

    Been searching high and low and can't find how to do this.

    Simply want to have the background image for an element change when the page is reloaded.

    Using Metro Pro which already has backstretch.js enqueued (which was mentioned in articles but I couldn't figure out for element background)

    May 23, 2016 at 2:04 am #186119
    Brad Dalton
    Participant

    I don't think it's that simple however i will spend some time on this and see what i can come up with.


    Tutorials for StudioPress Themes.

    May 23, 2016 at 2:08 am #186120
    wasanajones
    Member

    thanks, would be much appreciated.

    I know much has been done for page backgrounds, so I wonder about adding a class to that arrangement.

    of course it is about 4 steps above my skill-set pay grade to figure out.

    May 23, 2016 at 8:32 am #186131
    Brad Dalton
    Participant

    Link to your site please.

    Do you mean background for the body element?


    Tutorials for StudioPress Themes.

    May 23, 2016 at 8:38 am #186132
    wasanajones
    Member

    What I had in mind was for any div element, being able to have the background image change when a page was refreshed.

    not the whole page background (which people do using backstretch and other magical wizardry)

    I was hoping for a CSS solution -- but it might be a matter of diminishing returns as it may not be as simple as I imagined.

    thanks

    May 23, 2016 at 9:44 am #186135
    Brad Dalton
    Participant

    Something like this http://wpsites.net/web-design/random-images-using-php-code/


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble