Site logo

Archived topic

Adding this code

3 replies · Started by Manuel on April 9, 2020

Viewing posts 1–4 of 4

Hi all,
thanks again for your awesome GP and GPP :-)

I'm not very familiar with coding so here's my question:
How can I add this code /function:

lax.addPreset("myCoolPreset", function() {
	return (
		"data-lax-opacity": "(-vh*0.8) 40, (-vh*0.6) 0",
		"data-lax-rotate": "(-vh*2) 1000, (-vh*0.5) 0" 
	)
})

Tried it with the Code Snippet Plugin but didn't work.

Thanks a lot in advance!

Hi there,

I assume its some Javascript ? If so try this:

1. Create a new Hook element.

https://docs.generatepress.com/article/hooks-element-overview/

2. Add your code to the element wrapped like so:

<script type="text/javascript">
/* Your code here*/
</script>

3. Select the WP_Footer hook.
4. Set the Display Locations to entire site or wherever you need it.

Oh, too easy.
Thanks a lot David

You're welcome

This archived topic is closed to new replies.