• 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

Define specific page to load specific image on Agency Pro theme

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 › Define specific page to load specific image on Agency Pro theme

This topic is: not resolved

Tagged: agency pro, background image

  • This topic has 6 replies, 2 voices, and was last updated 9 years, 7 months ago by Chris35.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • September 24, 2016 at 11:20 am #193653
    Chris35
    Member

    HI !
    Whole my website have the same background image, using the intheme script :

    jQuery(document).ready(function($) {
    $("body").backstretch([BackStretchImg.src],{duration:3000,fade:750});
    });

    How can i define a specific background image to one page / post ?
    Thanks for helping me :o)


    Création de site internet à Rennes

    https://www.rennes-internet.com
    September 24, 2016 at 11:40 pm #193660
    Brad Dalton
    Participant

    Hi

    Its not a simple modification to the themes existing code unless you find a plugin which enables you to change the custom background image on any page.


    Tutorials for StudioPress Themes.

    September 25, 2016 at 4:13 am #193666
    Chris35
    Member

    i will not install a plugin for just a litle parameter of code to insert 🙂


    Création de site internet à Rennes

    September 29, 2016 at 3:42 am #193867
    Brad Dalton
    Participant

    What you need to do is add a conditional or ternary operator to the following line of code so the value for the variable $image is changed for a specific post or page

    $image = get_option( 'agency-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );

    Then you can hard code the path to the image or use a custom field if wanting to change multiple images.


    Tutorials for StudioPress Themes.

    September 29, 2016 at 3:58 am #193869
    Chris35
    Member

    Thank you Brad 🙂
    where i can put this ? Just like this in my snippet file ?
    $image = get_option( 'agency-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );

    and the custom field name must be agency-backstretch-image, yes ?


    Création de site internet à Rennes

    September 29, 2016 at 4:08 am #193871
    Brad Dalton
    Participant

    You will need to modify the entire code snippet .

    My suggestion is a point in the right direction.

    The actual modification of code will need to be completed by yourself.


    Tutorials for StudioPress Themes.

    September 29, 2016 at 4:19 am #193872
    Chris35
    Member

    Nice, i'm on it 😉


    Création de site internet à Rennes

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 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

© 2026 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