12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Nov 17, 2020

Different ACF Background Images at Different Breakpoints in Oxygen

Sridhar Katakam

As of version 3.6, there seems to be a bug in Oxygen where an element's background image coming from a ACF field selected at responsive breakpoints does not appear on the front end.

This members-only tutorial provides a workaround to fix this by injecting custom CSS at the end of Oxygen's stylesheet.

Step 1

If you have not already, create a Advanced Custom Fields field group having two Image-type custom fields labelled say, "Desktop Background" and "Mobile Background". Set the Return Format to Image URL. Set the group to appear on your desired post type, say, Page for example.

Step 2

In the Oxygen editor add the element for which you would like to set different background images at different media queries.

At Advanced > Background set Background Repeat to no-repeat and Left and Top values to 50% each.

Step 3

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: Set different images as background for a section on desktop and mobile

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right