Hi guys,
I’m hoping someone here can help me with something that’s been annoying me for the last 20/30 minutes!
So, in the Gutenberg editor.
If we paste in the URL for a WordPress plugin, like this:
*https://wordpress.org/plugins/wp-smushit/*
It automatically changes to an embed, that looks like this:
​
That’s awesome, I like it.
But, how do I get it to **open the links in a new tab?**
I have tried everything I can think of.
Here’s the code when you “edit as HTML” in the editor:
​
​
**Actual Code:**
<figure class=”wp-block-embed is-type-wp-embed is-provider-plugin-directory wp-block-embed-plugin-directory”><div class=”wp-block-embed\_\_wrapper”>
</div></figure>
​
I’ll admit, I am a noob when it comes to coding
I did try adding **rel=”noopener”** to different parts of the code, but it kept saying “This block contains unexpected or invalid content”.
I could have been putting it in the wrong place, maybe?
*Or, that’s just totally not how you do it and I’m more of an idiot than I realised! (more likely lol)*
​
Anyways, I’d love it if someone could help me with this.
I definitely want to use the embeds, but only if they open in a new tab.
​
Thanks in advance,
Mr C.B.
​
P.S.
I am pretty 50/50 if this breaks rule 9 of the sub or not tbh.
But, I’m hoping it doesn’t!
(Rule #9 = No Generic CSS/HTML questions)
[ad_2]