Customizer: path in element attribute

Hi all, hope you are all doing fine.

I am looking for a solution to this: I have html code with some attributes in it, for a parallax effect, like this:

<div id="headerJumbotron" class="jumbotron parallax-window" data-parallax="scroll" data-speed="0.3" data-bleed="1" data-position-y="top" data-image-src="<?php echo get_stylesheet_directory_uri(); ?>/img/roadWithBendsAheadSign2.jpg">

What I’m trying to achieve, is to set the data-image-src attribute using the customiser.

So, it should be possible to give in a path, using the customiser, to change the value of data-image-src, being <?php echo get_stylesheet_directory_uri(); ?>/img/roadWithBendsAheadSign2.jpg

Is that even possible?

Thanks for all your advice!

Never mind. Found it.

In the customiser section of Pinegrow, there’s a ‘theme mod to attribute’ section. You can use that for it.

1 Like