Lukas Block
asked 10 years ago

Hello, I want to show a video on the mainpage of the Wall-theme (like in the demo). But when I insert the iframe-YT-code and choose format “video”, nothing happens.
http://picload.org/image/cgolgrc/unbenannt.png

2 Answers
DominicStaff
answered 10 years ago

 Take a look at the following solution:
1. Log in to Dashboard  > Appearance > Customize > Custom Code, add the following code to the “Header Code” section.

 <style>
.masonry .format-video .item-content iframe, .masonry .format-video .item-content embed {
    display: block;
}
</style>

 – Add the following code to the “Footer code” section:

  <script>
jQuery(function($){
 function responsiveIframe() {
   $('iframe').each(function(){
       if ( ! $(this).hasClass('twitter-tweet') ) {
           var iw = $(this).attr('width');
           var ih = $(this).attr('height');
           var ip = $(this).parent().width();
           var ipw = ip/iw;
           var ipwh = ih*ipw;
           $(this).css({
               'width': ip,
               'height' : ipwh,
           });
       }
   });
 }

 $(document).ready(function(){
  responsiveIframe();
 });

 $(window).resize(function(){
  setTimeout(function(){
   responsiveIframe();
  },500);
 });
 $('.masonry').masonry('reload',function(){
  setTimeout(function(){
   responsiveIframe();
  },500);
 });
});
</script>

2. Open the functions.php file. Find the line 660 & line 661. Replace the following code:

 add_filter('the_excerpt', 'wallpress_strip_tags');
add_filter('the_content', 'wallpress_strip_tags');

With new code:

 //add_filter('the_excerpt', 'wallpress_strip_tags');
//add_filter('the_content', 'wallpress_strip_tags');

Hope this helps !

Lukas Block
replied 10 years ago

Hi Dominic, thanks! It worked! Will this be fixed in a new version (maybe for WordPress 4)?

Dominic Staff
replied 10 years ago

We will fix this issue in the next version.

Brian Mitchell
answered 10 years ago

Dominic,
Greetings. When I noticed my iframe link video would not appear on the main page I made a post about the videos (clip syndicate news videos) and then set up a separate page where I put the iframe html. Within the commentary of the post I inserted a click here link to the page where the videos were. This worked i.e. clicked on post link and went to page in new window where you could click whatever item you wanted. I tried out the above and it worked for me too except that my post now also included 3 of the 6 videos that were on the separate video page. I’ve taken out the new coding. FYI the post categories Ive set are “main menu” and “news” while the page option “Get post from category” is set to featured.
Cheers
Brian

Powered by DW Question & Answer Pro