G
G
Gattibugatti2020-07-11 01:43:54
JavaScript
Gattibugatti, 2020-07-11 01:43:54

Am I trying to reconnect JS scripts in wordpress correctly?

js scripts are connected to wp_footer through the plugin (see screenshot)
5f08ee66a3eed170137798.png
, there is a need to connect them in a separate file (via function.php).
To connect these scripts, it is enough to remove them from custom codes and add them to a separate file, which is connected using wp_enqueue_script in function.php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2020-07-11
@azerphoenix

Well... you have a js code wrapped around it <script>.*</script>
Remove these tags, create a separate js file, and then use wp_enqueue_script to include it. Since the script must work with jQuery, it will not be superfluous to add a script dependency on jQuery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question