• Using a previous response to this same question, I added the following code to check that the site would recognize the snippet.

    function ai_jobListingAutofill() {
    ?>
    <script>
        console.log('added snippet');
    </script>
    <?php
    }
    add_action( 'wp_footer', ‘ai_jobListingAutofill’);

    I don’t see anything in the Console nor do I get an alert box when I change log to alert.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Unfortunately, I’m not able to reproduce this problem – the code appears as expected in the footer area on the front-end of the site, and I can see the console message/alert box.

    Have you verified whether the code is showing up in the page source?

    The only problem I can see is the incorrect use of quotations around the function name, but this could just be a formatting from this forum.

    add_action( 'wp_footer', 'ai_jobListingAutofill');

    Another thing to try is rewriting the snippet to remove named functions:

    add_action( 'wp_footer', function () {
    	?>
    	<script>
    		console.log('added snippet');
    	</script>
    	<?php
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Add JS File to Snippet – Revisited’ is closed to new replies.