How to remove javascript code from only some pages
-
Hello. As you know, we can add any javascript code we want to any page with hooks. Like this:
function javascript_function() {
if (is_single ('XXXX')) {
?>
<script>
// insert your JavaScript code here
</script>
<?php
}
}
add_action('wp_footer', 'javascript_function');So how can we remove any javascript code from only XXXX post…? I searched but still couldn’t find a solution. Many old snippets don’t work.
I would be glad if you could help.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.