Javascript wrapped in php
-
Hi,
I’m having a lot of trouble running this script in a PHP snippet (and variations of it, tried everything i could think of)
could anyone help me ? (get_field is from ACF)
add_action(‘init’,’fn_concours’);
function fn_concours() {
if (in_array(‘Oui’,get_field(‘concours_actif’))){
echo ‘<script type=”text/javascript”>’;
echo ‘$(document).ready(function(){
$(“.menu-item-4336 a”).css(“background-color”,”#cc0000 !important”);
$(“.menu-item-4336 a”).css(“color”,”#fff !important”);
});’;
echo ‘</script>’;
}
}The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Javascript wrapped in php’ is closed to new replies.