• 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

Change to backstretch image url

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 › Change to backstretch image url

This topic is: resolved

Tagged: backstretch, CDN

  • This topic has 2 replies, 1 voice, and was last updated 7 years, 9 months ago by darren_c.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 27, 2015 at 7:18 am #157664
    darren_c
    Member

    I'm using a content delivery network to serve images so the source url for each is changed from:

    https://mysite.com/media/image123.jpg 
    to 
    https://cdnurl.com/media/image123.jpg

    This works fine except for the backstretch image which is called from the original url. How do I change this so it's called from the CDN url? I see the relevant code in functions.php is

    wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', get_background_image() ) ) );

    Can I just put the prefered url into here?

    June 29, 2015 at 10:33 am #157845
    darren_c
    Member

    After a lot of trial and error I have this and it seems to work:

    wp_localize_script( 'agency-pro-backstretch-set', 'BackStretchImg', array( 'src' => 'https://cdnurl.com/media/image123.jpg' ) );

    June 30, 2015 at 1:57 am #157901
    darren_c
    Member

    Since no one wants to comment I'm closing this as solved.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change to backstretch image url’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

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