Tagged: custom, enfold, javascript
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
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