Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #721274

    Hey guys,

    I need to add a custom attribute to all “Google Maps” elements right before the src=”filename.js” within their <script> tags. How can I do this? Using a child theme.

    Thanks,
    eC

    #722082

    Hey eC,

    You can try adding following code to functions.php file of your child theme in Appearance > Editor

    function remove_title_attr(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.your-target-element').attr('your-attr','your-attr-value');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'remove_title_attr');

    If that does not help, please elaborate on the changes you would like to make.

    Best regards,
    Yigit

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.