Javascript doesnt function on some pages

Hi,
I’m trying to implement a piece of Javascript on my site, this is it:
function wpb_hook_javascript_header() {
?>

<?php
}
add_action(‘wp_head’, ‘wpb_hook_javascript’);

I’ve tried to place it inside functions.php, inside theme options JS, I’ve also tried to install header and footer plugin but it shows only on english version of the site.

This is my site: www.mediana.com

How can I make it visible on all the pages and languages? I prefer to implement the code and not by plugin.

One thing: when I’m logged into the WP admin panel I can see it everywhere but the minute I logout it turns as mentioned above.

Thanks,
Anita

Hello Anita,

Please edit this line of code in the functions.php:

add_filter( ‘wpcf7_remote_ip_addr’, ‘wpcf7_anonymize_ip_addr’ );

to

add_filter( 'wpcf7_remote_ip_addr', 'wpcf7_anonymize_ip_addr' );

Also, I have checked the pages of your site and the script is loaded correctly. Would you mind sending a direct link to the page that has an issue?

Thank you.

Hi Jade,
but the two lines seam identical, where is the difference?
I’ve also checked the site and now the div appears correctly. Have you done something to correct it? Because I didn’t touch a thing so it is strange that now works.

Regards,
Anita

Hi Anita,

Yes, I check your site as well and the LUTECH GROUP dropdown menu works fine on both English and Italian. That script is standalone so it should work fine when added to the child theme’s functions.php file.

The difference is the quotes, yes the quotes ' versus the later is an invalid character in PHP and it can break your functions.

Thanks,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.