Notifications
Clear all

help

5 Posts
3 Users
1 Likes
128 Views
Sergido
Posts: 41
Topic starter
(@sergido)
Trusted Member
Joined: 3 years ago

there is some way that the "HTML" can be put in the threads since I see that it does not appear in the themes, and it would be good if it came out.

4 Replies
Robert
Posts: 9713
Admin
(@robert)
Support Team
Joined: 7 years ago

@sergido,

Yes, you can put HTML using the {;} button, which opens the source code of your post.

 

Reply
Sergido
Posts: 41
Topic starter
(@sergido)
Trusted Member
Joined: 3 years ago

@robert

i try to try to upload youtube videos with html as you mention, and it doesn't work

 

For example, if I want to upload this video: (does not upload it in the thread)

<iframe width="1189" height="669" src="https://www.youtube.com/embed/9rYfVDawF-w" title="COMO APRENDÍ A QUERERME/ Desirée Vila" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Reply
dimalifragis
Posts: 1638
(@dimalifragis)
Noble Member
Joined: 2 years ago

Add this code to your theme's functions end or use

https://wordpress.org/plugins/code-snippets/ to add it (you decide)

Then just paste the url of youtube video in a post.

 

add_filter('wpforo_content_after', 'wpforo_custom_video_embed', 10);
function wpforo_custom_video_embed( $content ){
    $paterns = array();
    $paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";
    $paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtu.be\/([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";
    $content = preg_replace($paterns, "<iframe width=\"420\" height=\"280\" src=\"//www.youtube.com/embed/$1\" frameborder=\"0\" allowfullscreen></iframe>", $content);
    return $content;
}

And PLEASE use some DESCRIBING Titles when you ask for Help. HELP means nothing.

Reply
Robert
Posts: 9713
Admin
(@robert)
Support Team
Joined: 7 years ago
Posted by: @sergido

For example, if I want to upload this video: (does not upload it in the thread)

<iframe width="1189" height="669" src="https://www.youtube.com/embed/9rYfVDawF-w" title="COMO APRENDÍ A QUERERME/ Desirée Vila" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Inserting iframes to post content is the most terrible and unsecure thing that is fully forbidden. You should insert the YouTube link and see the iframe automatically. So just use the code above or purchase wpForo Embeds addon to turn URLs to video players and content widgets.

Reply
Share: