I am trying to migrate my website to Wordpress and can’t seem to successfully use my interactions and functions on the Wordpress theme. I created a Wordpress theme from scratch and everything works perfectly. I enqueued my new scripts.js file that includes all of Webflow’s functions.js code and it seems to work as the file loads, but no interactions work.
I sorted it out and the JS generated in Webflow works perfectly in Wordpress. The JS is linked to the data-wf-page attribute (page ID). I created a workaround by:
Creating a variable on each page template on Wordpress. The variable is the page ID coming from Webflow.
On the header.php file, I print that variable.
That way, every time the header is used, it will automatically get the correct Page ID, making the interactions work. I also put it on single.php and page.php templates to enable their use on new pages and ensuring they always work.