How to make a function to play only on the home page?

I feel like I’m missing a lot of context from your question. If you are only asking how to execute a script on the homepage (and not on other pages), you can use the is_front_page() function. You can wrap your entire script in an if statement, like below: <?php if ( is_front_page() ) : ?> … Read more