Select Page

I am working on a customer’s site which uses a modified Divi theme, and the Divi Person module social links don’t open in a new window. Some of the Divi modules have a setting for this, and this one doesn’t.

I love Divi but their ability to give us most of the solution is often maddening.

The code you need to change is located in Divi/includes/builder/main-modules.php. If you’ve made it this far, it’s likely you already have a child theme. If not, now is the time to create one.

Search for et_pb_font_icon et_pb_facebook_icon and paste target=_”blank” before the closing tag >.  The code is the same for all social icons in that block.

if ( ” !== $facebook_url ) {
$social_links .= sprintf(
‘<li><a href=”%1$s” class=”et_pb_font_icon et_pb_facebook_icon” target=_”blank”><span>%2$s</span></a></li>’,
esc_url( $facebook_url ),
esc_html__( ‘Facebook’, ‘et_builder’ )
);
}

See it in action here.