Opening RSS Block’s Links in New Tabs

Looking to have links output by RSS Block (in the block editor) in new tab/window when using Bricks?

Add this in your Bricks template/Page at Settings (gear icon) → PAGE SETTINGS → CUSTOM CODE → Body (footer) scripts:

document.querySelectorAll(".wp-block-rss__item-title a").forEach((link) => {
    link.setAttribute("target", "_blank")

Note: For custom JS added in the builder to be applied on the frontend, there must be at least one element added to the canvas.

Instant access to 390+ Bricks code tutorials with BricksLabs Pro

Leave the first comment