View file StuffPost/stuffpost/single-video.php

File size: 3.17Kb
<?php
/*
 * Template Name: Video
 * Template Post Type: post
 */
//theme header
get_header();
//sidebar is hidden?
$weart_sidebar = get_post_meta($post->ID, "weart_hide_sidebar", true);
?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

    <div class="container mt-3">
      <!-- VIDEO -->
        <div class="video-post">
          <div class="row">
            <div class="col-lg-12">
              <?php if(get_post_meta($post->ID, "weart_video_audio", true)) { ?>
                <div class="embed-responsive embed-responsive-16by9 pb-1"><?php echo get_post_meta($post->ID, "weart_video_audio", true); ?></div>
              <?php } else{?>
                <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) : ?>
                  <div class="video-featured-img"><img class="lazy" src="lazyload" data-src="<?php the_post_thumbnail_url( 'weart-featured' ); ?>" alt="<?php the_title(); ?>" /></div>
                <?php endif; ?>
              <?php } ?><!-- featured-img-video -->
            </div>
            <div class="col-lg-12">
              <div class="row no-gutters">
                <?php $args = array( 'post_type' => 'post','orderby' => 'rand', 'posts_per_page' => '4', 'ignore_sticky_posts' => true, 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-video'), ) ) );
                $video_query = new WP_Query( $args ); $i=1;
                if ( $video_query->have_posts() ) { while ( $video_query->have_posts() ) { $video_query->the_post(); ?>
                  <div class="col-lg-3 col-md-6"><?php weart_itemInner(array('font'=>'h6','bg'=>'bg-100')) ?></div>
                <?php } } wp_reset_postdata(); ?>
              </div>
            </div>
          </div>
        </div>

      <!-- HEADER -->
        <header class="row mt-5">
          <div class="col-lg-9 c-black l-black offset-lg-1">
            <div class="meta row align-items-center">
              <div class="col-lg-6 actual-meta"><?php weart_by(array('color'=>'c-meta l-black')) ?></div>
              <div class="col-lg-6 share"><?php if ( shortcode_exists( 'ssba-buttons' ) ) { echo do_shortcode('[ssba-buttons]'); } ?></div>
            </div><!-- .meta -->
            <hr class="mb-4 mt-1">
            <h1 class="title font-weight-bold my-3"><?php the_title() ?></h1>
          </div>
        </header>

      <!-- CONTENT -->
        <div class="post-container pt-4">
          <div class="row pb-5">
            <div class="col-lg-7 offset-lg-1
            <?php if(!is_active_sidebar( 'sidebar-article') || $weart_sidebar == "hide" ){ ?>offset-lg-2<?php } ?>">
              <?php get_template_part( 'parts/post','content' ) ?>
            </div>
            <?php get_sidebar(); ?>
          </div>
        </div>
    </div>
  </article>
<?php endwhile; else: weart_noposts(); endif; ?>

<?php if(get_theme_mod( 'want_home_related', 0 )){ ?>
  <div class="home-recommendation pt-5">
    <div class="container"><?php get_template_part( 'index' );  ?></div>
  </div>
<?php } ?>

<?php get_footer() ?>