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:

<script>
document.querySelectorAll(".wp-block-rss__item-title a").forEach((link) => {
    link.setAttribute("target", "_blank")
})
</script>
rss-block-links-new-window-WordPress

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.

Leave the first comment