Problem when using conditional tag 'is_front_page' and a tag
-
I’m trying to display an HTML5 video in the header of the frontpage but the page doesn’t load and I get an error message Parse error: syntax error, unexpected ‘{‘, expecting ‘,’ or ‘;’ in
This is the code that I’m using;
<?php if (is_front_page())echo '<video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="1278" height="720" poster="https://imagestocksg.s3.amazonaws.com/preview/homepage-poster-test.jpg" data-setup='{"example_option":true}'> <source src="https://imagestocksg.s3.amazonaws.com/preview/homepage-video-test.mp4" type='video/mp4' /> </video>'; ?>
If I use an embedded Youtube video with an iframe it works fine;
<?php if (is_front_page())echo '<iframe id="video-bg" src="//www.youtube.com/embed/vLUNWYt3q1w?rel=0&autoplay=1&controls=0&loop=1" frameborder="0" allowfullscreen></iframe>'; ?>
I’m not a coder and really struggling to find a solution for this. I’ve looked everywhere. I’m assuming there’s an error with the coding but not sure what it is?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Problem when using conditional tag 'is_front_page' and a tag’ is closed to new replies.