Reputation: 125
I have a video gallery page in wordpress, http://rabindraadhikari.com/category/videos/. I am using the embed shortcode:
<?php
$embedurl = wp_filter_nohtml_kses(get_the_content());
if (!empty($embedurl)) {
$frame= apply_filters('the_content', "[embed]" . $embedurl . "[/embed]");
echo $frame;
}
?>
But some videos are not embeded(first 3 are not working in this case). I have done everything i can to make it work. But i could not figure out what's going wrong.
Upvotes: 0
Views: 2447
Reputation: 4764
Some videos may not be embedded because the video's owner on YouTube has disabled embedding. Visit the video's YouTube page and look under "Embed". It may say: "Embedding disabled by request".
Here is an example.
Upvotes: 1
Reputation: 4230
UPD: I suggest using default youtube embed code. So you will have something like
<?php
$embedurl = wp_filter_nohtml_kses(get_the_content());
if (!empty($embedurl)) {
$frame= apply_filters('the_content', '<object width="420" height="315" data="' . strip_tags($embedurl) . '" frameborder="0" allowfullscreen></object>');
echo $frame;
}
?>
Upvotes: 3