Created
September 26, 2021 04:47
-
-
Save hegemanjr/25c53d17cf1f07a200cc011ff0073c76 to your computer and use it in GitHub Desktop.
Open WordPress RSS feed block links in new tab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Add target="_blank" to RSS block links */ | |
let rssTitles = document.getElementsByClassName('wp-block-rss__item-title'); | |
let len = rssTitles.length; | |
for(let i=0; i<len; i++) | |
{ | |
let link = rssTitles[i].getElementsByTagName('a')[0]; | |
link.target = "_blank"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment