• Resolved Mad Ascent

    (@mad-ascent)


    Hello,

    I m trying to add this script to the header but with no luck this is what my code looks like and its not working at the moment.

    add_action( 'wp_head', function () { ?>
    
    <script>
    
    	jQuery(document).ready(function($) {
    		$('img[title]').each(function() { $(this).removeAttr('title'); });
    	});
    	
    </script>
    
    <?php } );
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Mad Ascent

    (@mad-ascent)

    No support for a week? Rly … 1 star

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @mad-ascent,

    Apologies for the delayed response! At times other parts of my life can get super busy, and the support threads stack up.

    Additionally, I tend to prioritise support requests that relate to the plugin itself. Requests like these can be difficult to help out with, as I don’t know how your site is built or how it works, and what particular element is causing this to not work.

    The one thing I can suggest now is ensuring that jQuery is loaded before this snippet is. I can’t spot any syntax or logical errors, so it’s likely something to do with the execution order.

    Thread Starter Mad Ascent

    (@mad-ascent)

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add script to header’ is closed to new replies.