Site logo

Archived topic

How to Open wp:social-link in New Tab

3 replies · Started by Felix on November 1, 2020

Viewing posts 1–4 of 4

Hi GP Team,

I can't find an option in the block-editor, which leads to links of the wp:social-links-blocks being opened in a new tab.

Could you help me with the necessary statement and where to add it in the code below, please?

Cheers

Hi,

I'm afraid you'll have to edit that part of WordPress Social Links block or create a script that adds the target="_blank" attribute to make that work.

That said, consider using a plugin that does the job like Social Icons Widget & Block by WPZOOM.

Hi Elvin,
I tried adding the target="_blank" attribute at different points in the code above, but the code-editor wouldn't accept it (basically deletes the whole line of code, when I try to update the page).

Could you show where exactly to place it in this line of code:
<!-- wp:social-link {"url":"https://facebook.com/","service":"facebook"} /-->

Much appreciated

Hi there,

you can't edit the comments without it breaking the Block.

Instead you can create them using the GenerateBlocks plugin:

https://wordpress.org/plugins/generateblocks/

Its Buttons block allows you to add Icons and remove the link text and style them however you want. When you add the link URL click the 3 dot menu where you can select a new tab.

This archived topic is closed to new replies.