Notifications
Clear all

[Solved] Open link in new tab + embed Youtube

7 Posts
2 Users
1 Reactions
1,635 Views
Posts: 168
Customer
Topic starter
(@danniee)
Member
Joined: 6 years ago

Hi!

Just bought the media addon. If I add a plain youtube link, it doesn't actually embed the clip like I was hoping it would. The commenter must use the embed code from Youtube? If so, this won't be obvious to the commenters.

Also, is there a way to make links open in a new browser tab? As it is now, it redirects the visitor to a new website.

6 Replies
Astghik
Posts: 6154
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @danniee,

The commenter must use the embed code from Youtube? If so, this won't be obvious to the commenters.

No the users just need to copy the URL and paste it in the comment content. You can check it here: http://wpdiscuz.com/addons/wpdiscuz-media-uploader/#comments

Please navigate to Dashboard > Comments > Settings > Addons > Uploader admin page, make sure the "Allow media embedding function" is enabled. 

Also, is there a way to make links open in a new browser tab? As it is now, it redirects the visitor to a new website.

Please put the following js code in your active theme js file:

jQuery('#wpcomm .wc-comment-text a').attr('target', '_blank');

Here is an instruction you can use: https://www.ostraining.com/blog/wordpress/custom-js/

Posts: 168
Customer
Topic starter
(@danniee)
Member
Joined: 6 years ago

Hi,

That's the thing. I already have "Allow media embedding function" enabled, but it didn't work when I posted a regular Youtube link. Only when I used Youtube's own embedding link.

Posts: 168
Customer
Topic starter
(@danniee)
Member
Joined: 6 years ago

Nevermind, it seems to work as intended now. Thanks for the help.

1 Reply
Astghik
Admin
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6154

@danniee,

Please let us know do both issues solved? 

 

Posts: 168
Customer
Topic starter
(@danniee)
Member
Joined: 6 years ago

Yes, both issues solved. However, why can't it be a default thing that links open in new tab or at least allow this option in the backend?

1 Reply
Astghik
Admin
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6154

@danniee,

The target="_self" to the <a> tag is set by WordPress side not wpDiscuz.

why can't it be a default thing that links open in new tab or at least allow this option in the backend?

We'll take this into consideration for future updates. If the solution works just keep it in the file, you'll get it resolved. 

 

Share:
Scroll to top