Notifications
Clear all

[Solved] Open link in new tab + embed Youtube  


danniee
Posts: 13
Customer
(@danniee)
Member
Joined: 1 year 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.

Topic Tags
6 Replies
Astghik
Posts: 3785
Admin
(@astghik)
Support Team
Joined: 2 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/

danniee
Posts: 13
Customer
(@danniee)
Member
Joined: 1 year 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.

danniee
Posts: 13
Customer
(@danniee)
Member
Joined: 1 year ago

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

1 Reply
Astghik
Admin
(@astghik)
Joined: 2 years ago

Support Team
Posts: 3785

@danniee,

Please let us know do both issues solved? 

 

danniee
Posts: 13
Customer
(@danniee)
Member
Joined: 1 year 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
(@astghik)
Joined: 2 years ago

Support Team
Posts: 3785

@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: