JavaScript snippet in footer specific page
-
Hello,
I trying adding Javascript in the footer.
I’m adding this code in my functions.php:
function locatie_winkel($pid){ if (is_single()) { global $post; if($post->ID=="624"){ // only for post Id = 624 echo "<script>alert('hello world');</script>"; } } } add_action( 'wp_footer', 'locatie_winkel' );And this is the id of the page:
../wp-admin/post.php?post=624&action=editBut when i look in the frontend to this page, then i don’t see the script in the source code.
What doing wrong??
Regards,
Christophe
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘JavaScript snippet in footer specific page’ is closed to new replies.