If you want to enqueue inline script due to dependancies in WordPress, Add the following code to the functions.php file of your current activated WordPress theme.
1 2 3 4 5 6 7 8 9 10 | function fwm_print_my_inline_script() { if ( wp_script_is( 'some-script-handle', 'done' ) ) { ?> <script type="text/javascript"> // js code goes here </script> <?php } } add_action( 'wp_footer', 'fwm_print_my_inline_script' ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.