Hi, I have read through similar posts and tried several ways to get this to work, but I’m having trouble getting a script to run in X-Pro. I am using Bakery Visual Composer to build the page, and the Pro-Child theme. Not sure if that is relevant to know.
I have linked a js file in my functions PHP file like this:
function wpb_adding_scripts() { wp_register_script('my_amazing_script', get_template_directory_uri() . '/js/aos.js', array('jquery'),'1.1', true); wp_enqueue_script('my_amazing_script'); } add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
The aos.js file is placed here:/ themes>pro-child>js
But there is another part that I think calls the script to work.
AOS.init();
I have added this into the custom js section in X-Pro theme options
I don’t think this needs any function tags around it right? it’s only calling the function.
Then I have linked an external CSS file related to this js feature, into my styles.css file in my child theme.
@import url('aos.css');
The css file is placed in a css directory here: /themes>pro-child>css
Then there is some html on the page that is supposed to be manipulated by this JS and CSS code.
It’s a small block of text on the side of the page that is hidden, and slides into view and becomes visible when the user scrolls past an element with a relevant #id.
It all works in codepen, so I know it isn’t the js or css, it’s how I have integrated it that is causing the issue.
When I load the page, the browser inspector shows the various [data…] values, so it seems the CSS is being read.
Therefore I assume it’s the way I am calling or integrating the js.
I’m hoping you can help me, by telling me if I have added any of these elements incorrectly to work with X-Theme.
Many thanks


