• anghayes

    (@anghayes)


    Trying to add video to a clients website that I didn’t design. It’s set with a homepage template, I’m not sure how to write the code to add the video to the template.

    The website is: [ redundant link removed ]

    The client would like to remove the product images on the home page and replace them with the video. I have uploaded the video to the media library.

    Here is what the current template code looks like:

    
    <?php
    /**
    * Template Name: Home Page Template
    */
    
    $page_id = get_queried_object_id();
    
    ?>
    <section id=”slider-banner” >
    
    </section>
    <!– About Us section –>
    <section id=”welcome-container” data-stellar-background-ratio=”0.3″>
    
    </div>
    </div>
    </div>
    </section>
    <?php if(! get_field(‘hide_cta_section’,$page_id)):?>
    <section class=”info”>
    
    </section>
    <?php endif;?>
    <!– production section starts here –>
    <section id=”production”>
    
    </div>
    <?php home_product_listing();?>
    </div>
    </div>
    </section>
    <?php
    if( ! get_field(‘hide_testimonial_section’, $page_id) ):?>
    <section id=”testimonials”>
    
    <ul class=”testimonial-slider”>
    <?php
    $posts_per_page = get_field(‘number_of_testimonials’) ? get_field(‘number_of_testimonials’) : -1;
    $args = array(‘post_type’ => ‘testimonial’,’posts_per_page’ => $posts_per_page);
    $query = new WP_Query($args);
    while($query->have_posts()):$query->the_post();
    $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()),’thumbnail’);
    ?>
    
    ” class=”pull-left”>
    
    </div>
    </div>
    
    <?php endwhile;wp_reset_postdata();?>
    
    </div>
    </div>
    </section>
    <?php else:?>
    <hr style=”margin-bottom:0;”>
    <?php endif;?>
    <?php if(! get_field(‘hide_timeline’,$page_id)):?>
    <section id=”timeline-section”>
    
    </div>
    </section>
    <?php endif;?>
    <?php
    if( ! get_field(‘hide_partner_section’,$page_id) ):?>
    <section id=”our-partners”>
    
    </div>
    </section>
    <?php endif;?>
    <?php
    if( ! get_field(‘hide_newsletter_section’,$page_id) ):?>
    <section class=”news-letter”>
    
    <br />
    <input type=”submit” value=”<?php if( get_field(‘news_letter_section_button_text’) ){ the_field(‘news_letter_section_button_text’); }else{ echo “Subscribe Now!”; } ?>” class=”btn btn-large” />
    </form>
    </div>
    </div>
    </div>
    </div>
    </section>
    <?php endif;?>
    

    Thanks so much for any help you can provide me!!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add video to template’ is closed to new replies.