Hello
I’m trying to get the contact link in my menu to open up a pop window but it requires data-rel=”lightcase:myCollection” to be added to the A link.
I’ve tried to follow this to get it to add something similar…
https://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_link_attributes
I’ve set up a hook to appear in wp-footer with the below script but can’t seem to get it to work…
<script>
function add_specific_menu_location_atts( $atts, $item, $args ) {
// check if the item is in the primary menu
if( $args->theme_location == ‘primary’ ) {
// add the desired attributes:
$atts[‘data-rel’] = ‘lightcase:myCollection’;
}
return $atts;
}
add_filter( ‘nav_menu_link_attributes’, ‘add_specific_menu_location_atts’, 45 );
</script>
Any ideas what I’m doing wrong?
Link is… http://185.20.51.60/~pjdservicesco/
Thanks
Dave