Hi, thanks for trying – it’s a bit of a strange one.
Hi Yigit, thanks for the help.
I’d already turned on the custom css fields.
I’ve added the above code with my changes but I still can’t get it to work. The class is being added when I check in Firebug (but not there when I view source?), and the code I need for the modal window is being added too – but the modal window doesn’t appear when I click on the link.
This is my code:
function add_custom_a_class(){
?>
<script>
jQuery(window).load(function(){
jQuery('.booknow-modal a').addClass('fancybox');
});
</script>
<div class="fancybox-hidden" style="display: none;">
<div id="book-act-now">
<?php echo do_shortcode('[contact-form-7 id="3615" title="Book Now"]'); ?>
</div>
<?php
}
add_action('wp_footer', 'add_custom_a_class');
Is there something I’m missing? The same code added to the header and footer works fine, so I’m wondering if it’s the window.load function that is preventing it from firing.