Dynamic JS in the theme

Hi guys,

Recenty I got an soft rejection for my first WordPress theme.
What I am asking you is what will be the best way to add custom dynamic JS in the functions.php file?

I need this scripts to be connected with the admin panel options and the PHP code will be the part of it.

Thanks :slight_smile:

Hi, use wp_add_inline_script - https://developer.wordpress.org/reference/functions/wp_add_inline_script/#user-contributed-notes

1 Like

@AN2-studio Thank you for the answer :slight_smile:
Was curios if I can add it via wp_head function in functions.php file cause it seems like easier method to do this.