Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Social links target issue

Home / Forums / Kadence Theme / Social links target issue

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
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

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

  • The forum ‘Kadence Theme’ is closed to new topics and replies.