[Resolved] How to Open wp:social-link in New Tab

Home Forums Support [Resolved] How to Open wp:social-link in New Tab

Home Forums Support How to Open wp:social-link in New Tab

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1513846
    Felix

    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

    #1513978
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1514766
    Felix

    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

    #1514837
    David
    Staff
    Customer Support

    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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.