October 4, 2022 at 9:21 am
Hi Kadence Folks,
I need to remove the target from the social icon links and found a previous post here from last year that fixed the Instagram icon link, specifically. But, when I try to create a second snippet to remove the target from the twitter icon using the same snippet but replacing ‘instagram’ with ‘twitter’, I get an error. I’m clearly doing something wrong, so would appreciate any help you can provide.
The site is *Login to see link
The working code snippet Ben had provided previously is:
add_filter( ‘kadence_social_link_target’, ‘custom_social_link_target’, 10, 2 );
function custom_social_link_target( $hidetarget, $item ) {
if ( ‘instagram’ === $item[‘id’] ) {
return true;
}
return $hidetarget;
}
I can save a new snippet replacing ‘instagram’ with ‘twitter’, but when I hit Activate, the following error message appears:
The snippet has been deactivated due to an error on line 3:
Cannot redeclare function custom_social_link_target.
Many thanks!
Sara