Notifications
Clear all

[Closed] help

5 Posts
3 Users
1 Reactions
720 Views
Posts: 79
Topic starter
(@sergido)
Estimable Member
Joined: 5 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: 10549
Admin
(@robert)
Support Team
Joined: 8 years ago

@sergido,

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

 

Posts: 79
Topic starter
(@sergido)
Estimable Member
Joined: 5 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>

dimalifragis
Posts: 2615
(@dimalifragis)
Famed Member
Joined: 4 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.

Robert
Posts: 10549
Admin
(@robert)
Support Team
Joined: 8 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.