Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.51 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Display Single Celebrity
  4.  *
  5.  * @author      Themeum
  6.  * @category    Template
  7.  * @package     Moview
  8.  *-------------------------------------------------------------*/
  9.  
  10. if ( ! defined( 'ABSPATH' ) )
  11.     exit; // Exit if accessed directly
  12.  
  13. get_header();
  14. ?>
  15.  
  16. <section id="main" class="clearfix">
  17.     <?php
  18.     while ( have_posts() ) : the_post();
  19.     $image_cover = get_post_meta($post->ID,'themeum_celebrity_images', true);
  20.     $cover = '';
  21.     if ( $image_cover ) {
  22.         $cover_img   = wp_get_attachment_image_src($image_cover, 'full');
  23.         $cover = 'style="background-image:url('.esc_url($cover_img[0]).');background-repeat:no-repeat;background-size: cover;background-position: 50% 50%;"';
  24.     } else {
  25.         $cover = 'style="background-color: #333;"';
  26.     }
  27.     $movie_type      = esc_attr(get_post_meta(get_the_ID(),'themeum_movie_type',true));
  28.     $movie_info      = get_post_meta(get_the_ID(),'celebrity_info',true);
  29.  
  30.     $facebook_url       = esc_attr(get_post_meta(get_the_ID(),'themeum_facebook_url',true));
  31.     $twitter_url        = esc_attr(get_post_meta(get_the_ID(),'themeum_twitter_url',true));
  32.     $google_plus_url    = esc_attr(get_post_meta(get_the_ID(),'themeum_google_plus_url',true));
  33.     $youtube_url        = esc_attr(get_post_meta(get_the_ID(),'themeum_youtube_url',true));
  34.     $movie_vimeo_url    = esc_attr(get_post_meta(get_the_ID(),'themeum_vimeo_url',true));
  35.     $instagram_url      = esc_attr(get_post_meta(get_the_ID(),'themeum_instagram_url',true));
  36.     $website_url        = esc_attr(get_post_meta(get_the_ID(),'themeum_website_url',true));
  37.     $movie_trailer_info = array();
  38.     ?>
  39.     <div class="moview-cover" <?php echo $cover;?>>
  40.         <div class="container">
  41.             <div class="row">
  42.                 <div class="col-sm-9 col-sm-offset-3">
  43.                     <div class="moview-info-warpper">
  44.                         <div class="moview-info">
  45.                             <h1><?php the_title(); ?></h1>
  46.  
  47.                             <?php if ($movie_type) { ?> <span class="tag"><?php echo esc_attr($movie_type); ?></span><?php } ?>
  48.  
  49.                             <div class="social-shares">
  50.                                 <div class="social-share-title"><?php _e('Share','themeum-core'); ?>:</div>
  51.                                 <?php echo themeum_social_share(get_the_ID()); ?>
  52.                             </div>
  53.                         </div> <!--//moview-info-->
  54.                         <div class="clearfix"></div>
  55.                     </div> <!--//moview-info-warpper-->
  56.                 </div> <!--//col-sm-9-->
  57.             </div> <!--//row-->
  58.         </div> <!--//container-->
  59.     </div> <!--//moview-cover-->
  60.  
  61.  
  62.     <div class="moview-details-wrap">
  63.         <div class="container" >
  64.             <div class="row">
  65.                 <div class="moview-wapper-total">
  66.                     <div id="moview-info-sidebar" class="col-sm-3 moview-info-sidebar">
  67.                         <div class="img-wrap">
  68.                             <?php if ( has_post_thumbnail() && ! post_password_required() ) { ?>
  69.                                 <div class="item-img">
  70.                                 <?php the_post_thumbnail('moview-profile', array('class' => 'img-responsive')); ?>
  71.                                 </div> <!--/.item-img-->
  72.                             <?php } //.entry-thumbnail ?>
  73.                            
  74.                             <div class="details-wrapper">
  75.                                
  76.                                 <?php if( is_array(($movie_info)) ) { ?>
  77.                                     <?php if(!empty($movie_info)) { ?>
  78.                                         <?php if($movie_info[0]['themeum_info_type'] != '') { ?>
  79.                                             <h3 class="title"><?php esc_html_e('Personal Info', 'themeum-core');?></h3>
  80.                                             <ul class="list-style-none list-inline">
  81.                                                 <?php foreach( $movie_info as $value ){ ?>
  82.                                                     <li class="common-list">
  83.                                                         <span> <?php echo esc_attr($value["themeum_info_type"]);?> </span> <?php echo esc_attr($value["themeum_info_description"]);?>
  84.                                                     </li>
  85.                                                 <?php } ?>
  86.                                             </ul>    
  87.                                         <?php } ?>
  88.                                     <?php } ?>
  89.                                 <?php } ?>
  90.                                
  91.                                 <?php if ( $facebook_url || $twitter_url || $google_plus_url || $youtube_url || $instagram_url || $website_url || $movie_vimeo_url ) { ?>
  92.                                     <div class="moview-social-icon">
  93.                                         <span>Social: </span>
  94.                                         <ul>
  95.                                             <?php if ( $facebook_url ) { ?>
  96.                                                 <li> <a class="facebook" href="<?php echo esc_url($facebook_url); ?>"> <i class="fa fa-facebook"></i> </a> </li>
  97.                                             <?php } ?>
  98.                                             <?php if ( $twitter_url ) { ?>
  99.                                                 <li> <a class="twitter" href="<?php echo esc_url($twitter_url); ?>"> <i class="fa fa-twitter"></i> </a> </li>
  100.                                             <?php } ?>                                         
  101.                                             <?php if ( $google_plus_url ) { ?>
  102.                                                 <li> <a class="googleplus" href="<?php echo esc_url($google_plus_url); ?>">  <i class="fa fa-google-plus"></i> </a> </li>
  103.                                             <?php } ?>                                         
  104.                                             <?php if ( $youtube_url ) { ?>
  105.                                                 <li> <a class="youtube" href="<?php echo esc_url($youtube_url); ?>">  <i class="fa fa-youtube"></i> </a> </li>
  106.                                             <?php } ?>                                         
  107.                                             <?php if ( $movie_vimeo_url ) { ?>
  108.                                                 <li> <a class="vimeo" href="<?php echo esc_url($movie_vimeo_url); ?>">  <i class="fa fa-vimeo"></i> </a> </li>
  109.                                             <?php } ?>                                         
  110.                                             <?php if ( $instagram_url ) { ?>
  111.                                                 <li> <a class="instagram" href="<?php echo esc_url($instagram_url); ?>">  <i class="fa fa-instagram"></i> </a> </li>
  112.                                             <?php } ?>                                         
  113.                                             <?php if ( $website_url ) { ?>
  114.                                                 <li> <a class="globe" href="<?php echo esc_url($website_url); ?>">  <i class="fa fa-globe"></i> </a> </li>
  115.                                             <?php } ?>
  116.                                         </ul>
  117.                                     </div> <!-- //social-icon -->
  118.                                 <?php } ?>
  119.                             </div> <!--//details-wrapper -->
  120.                         </div> <!--//img-wrap-->
  121.                     </div> <!--//moview-info-sidebar -->
  122.  
  123.                     <div class="col-sm-9 movie-info-warpper">
  124.                         <!-- movie-details -->
  125.                         <div class="moview-details">
  126.                             <!-- <div class="header-title">
  127.                                 <span><i class="themeum-moviewbook"></i></span> <h3 class="title">< ?php esc_html_e('Descripcion', 'themeum-core');?></h3>
  128.                             </div>-->
  129.                             <div class="moview-details-text">
  130.                                 <?php the_content(); ?>                        
  131.                             </div>
  132.                         </div> <!-- //movie-details -->
  133.  
  134.                         <?php
  135.                         $post_data = get_post( get_the_ID(),ARRAY_A );
  136.                         $post_data = $post_data['post_name'];
  137.  
  138.  
  139.  
  140.                         if($post_data){
  141.                             $args = array(
  142.                                 'post_type'     => 'movie',
  143.                                 'meta_query'    => array(
  144.                                                         array(
  145.                                                             'key'     => 'themeum_movie_actor',
  146.                                                             'value'   => $post_data,
  147.                                                             'compare' => '=',
  148.                                                         ),
  149.                                                     ),
  150.                                 'posts_per_page'=> 10
  151.                             );
  152.                             $query = new WP_Query( $args );
  153.  
  154.  
  155.  
  156.                             // The Loop
  157.                             if ( $query->have_posts() ) { ?>
  158.                             <!-- celebrity flim -->
  159.                             <div class="celebrity-filmography">
  160.                                 <div class="header-title">
  161.                                     <span><i class="themeum-moviewfilm"></i></span> <h3 class="title"><?php esc_html_e('Filmography', 'themeum-core');?></h3>
  162.                                 </div>
  163.  
  164.                                 <ul class="list-unstyled movie-film-list">
  165.                                     <li class="main-title">
  166.                                         <p class="pull-left"><?php _e('Movie Name','themeum-core'); ?></p>
  167.                                         <p class="pull-right"><?php _e('Ratings','themeum-core'); ?></p>
  168.                                     </li>
  169.                                 <?php while ( $query->have_posts() ) {
  170.                                     $query->the_post(); ?>
  171.  
  172.                                     <?php
  173.                                         $info = get_post_meta(get_the_ID(),'themeum_movie_trailer_info',true );
  174.                                         if( isset($info[0]["themeum_video_info_title"]) ){
  175.                                             if( $info[0]["themeum_video_info_title"] != '' ){
  176.                                                 $movie_trailer_info[] = $info[0];
  177.                                             }
  178.                                         }
  179.                                     ?>
  180.  
  181.                                     <!-- //main-title -->
  182.                                     <li>
  183.                                         <div class="details pull-left">
  184.                                             <?php if (has_post_thumbnail( get_the_ID() ) ): ?>
  185.                                               <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'moview-small' ); ?>
  186.                                               <div class="img-warp pull-left" style="background-image: url(<?php echo esc_url($image[0]); ?>); "></div>
  187.                                             <?php endif; ?>
  188.                                             <div class="filmography-info">
  189.                                                 <a href="<?php the_permalink(); ?>" class="movie-name">
  190.                                                     <strong><?php the_title(); ?></strong>
  191.                                                 </a>
  192.                                                 <div class="clelarfix"></div>
  193.                                                 <p class="celebrity-movie-genres"><?php echo get_post_meta( get_the_ID(), "themeum_movie_type", true ); ?></p>
  194.                                             </div>
  195.                                         </div>
  196.                                         <!-- //details -->
  197.                                         <div class="pull-right movie-rating-wrap">
  198.                                             <?php
  199.                                                 if (function_exists('themeum_wp_rating')) {
  200.                                                     echo themeum_wp_rating(get_the_ID(),'with_html');
  201.                                                 }
  202.                                             ?>
  203.                                             <span class="movie-rating-summary"><span>
  204.                                             <?php
  205.                                                 if (function_exists('themeum_wp_rating')) {
  206.                                                     echo themeum_wp_rating(get_the_ID(),'single');
  207.                                                 }
  208.                                             ?>
  209.                                             </span>/<?php _e('10','themeum-core'); ?></span>                                       
  210.                                         </div>
  211.                                       <!-- /.sp-moviedb-rating-wrap -->
  212.                                     </li>
  213.                                 <?php } ?>
  214.                                 </ul>
  215.                             </div> <!-- //celebrity flim -->
  216.                             <?php }
  217.                             wp_reset_postdata();
  218.                         }
  219.                         ?>
  220.  
  221.                         <!-- Trailers Videos -->
  222.                         <?php if( is_array(($movie_trailer_info)) ) {
  223.                               if(!empty($movie_trailer_info)) {
  224.                               $x=1;
  225.                               if($movie_trailer_info[0]['themeum_video_info_title'] != '' ){
  226.                             ?> 
  227.                             <div class="trailers-videos"> <!-- start trailers-videos -->
  228.                                 <div class="header-title">
  229.                                     <span><i class="themeum-moviewcamera"></i></span>
  230.                                     <h3 class="title"><?php esc_html_e('Trailers & Videos', 'themeum-core');?></h3>
  231.                                 </div>
  232.                                 <div class="row">
  233.                                     <?php
  234.                                     $i = 1;
  235.                                     if(is_array( $movie_trailer_info )){
  236.                                         if(!empty( $movie_trailer_info )){
  237.                                             foreach( $movie_trailer_info as $value ){
  238.                                                 if( $x <= 7 ){
  239.                                                     if ( $i == '1' ) {
  240.                                                         $image = $value["themeum_video_trailer_image"];
  241.                                                         $trailer_image   = wp_get_attachment_image_src($image[0], 'moview-medium'); ?>
  242.                                                         <div class="trailer-item leading col-sm-12">
  243.                                                             <div class="trailer">
  244.                                                                 <div class="trailer-image-wrap">
  245.                                                                     <?php if ($trailer_image[0]!='') { ?>
  246.                                                                         <img class="img-responsive" src="<?php echo esc_url($trailer_image[0]);?>" alt="<?php esc_html_e('trailers', 'themeum-core');?>">
  247.                                                                         <?php } else{ ?>
  248.                                                                             <div class="trailer-no-video"></div>
  249.                                                                     <?php }?>
  250.                                                                     <a class="play-video" href="<?php echo $value["themeum_video_link"];?>" data-type="<?php echo esc_attr( $value["themeum_video_source"] ); ?>">
  251.                                                                         <i class="play-icon themeum-moviewplay"></i>
  252.                                                                     </a>
  253.                                                                     <div class="content-wrap">
  254.                                                                         <div class="video-container">
  255.                                                                             <span class="video-close">x</span>
  256.                                                                         </div>
  257.                                                                     </div>
  258.                                                                 </div> <!-- trailer-image-wrap -->
  259.                                                                 <div class="trailer-info trailers-info">
  260.                                                                     <div class="trailer-info-block">
  261.                                                                         <?php if ( has_post_thumbnail() && ! post_password_required() ) { ?>
  262.                                                                             <?php the_post_thumbnail('moview-small', array('class' => 'img-responsive thumb-img')); ?>
  263.                                                                         <?php } //.entry-thumbnail ?>                                                          
  264.                                                                         <h4 class="movie-title"><?php echo esc_attr( $value["themeum_video_info_title"] );?></h4>
  265.                                                                         <p class="genry"><?php echo $movie_type; ?></p>
  266.                                                                     </div>
  267.                                                                 </div>
  268.                                                             </div>
  269.                                                         </div> <!--//trailer-item-->
  270.  
  271.                                                     <?php } else {
  272.                                                         $image = $value["themeum_video_trailer_image"];
  273.                                                         $trailer_image   = wp_get_attachment_image_src($image[0], 'moview-trailer');
  274.                                                         ?>
  275.                                                         <div class="trailer-item subleading col-sm-4">
  276.                                                             <div class="trailer">
  277.                                                                 <div class="trailer-image-wrap">
  278.                                                                     <?php if ($trailer_image[0]!='') { ?>
  279.                                                                     <img class="img-responsive" src="<?php echo esc_url($trailer_image[0]);?>" alt="<?php esc_html_e('trailers', 'themeum-core');?>">
  280.                                                                     <?php } else{ ?>
  281.                                                                     <div class="trailer-smail-no-video"></div>
  282.                                                                     <?php }?>
  283.                                                                     <a class="play-video" href="<?php echo $value["themeum_video_link"];?>" data-type="<?php echo esc_attr($value["themeum_video_source"]); ?>">
  284.                                                                         <i class="play-icon themeum-moviewplay"></i>
  285.                                                                     </a>
  286.                                                                 </div> <!-- trailer-image-wrap -->
  287.                                                                 <div class="trailer-info sp-trailers-info">
  288.                                                                     <div class="trailer-info-block">
  289.                                                                         <h4 class="movie-title"><?php echo esc_attr($value["themeum_video_info_title"]);?></h4>
  290.                                                                     </div>
  291.                                                                 </div>
  292.  
  293.                                                             </div>
  294.                                                         </div> <!--//trailer-item-->
  295.                                                     <?php }
  296.                                                     $i++;
  297.                                                     $x++;  
  298.                                                 }
  299.                                             }
  300.                                         }
  301.                                     }
  302.                                     ?>
  303.                                 </div> <!-- //row -->
  304.                             </div> <!-- //trailers-videos -->
  305.  
  306.                         <?php } ?>
  307.                         <?php } ?>
  308.                         <?php } ?>
  309.                        
  310.                         <?php
  311.                             comments_template();
  312.                         ?>
  313.  
  314.  
  315.                         <?php
  316.                             $count_post = esc_attr( get_post_meta( $post->ID, '_post_views_count', true) );
  317.                             if( $count_post == ''){
  318.                                 $count_post = 1;
  319.                                 add_post_meta( $post->ID, '_post_views_count', $count_post);
  320.                             }else{
  321.                                 $count_post = (int)$count_post + 1;
  322.                                 update_post_meta( $post->ID, '_post_views_count', $count_post);
  323.                             }
  324.                         ?>
  325.                         </div> <!-- //col-sm-9 -->
  326.                     </div>
  327.                
  328.             </div><!--/.row-->
  329.  
  330.         </div><!--/.container-->
  331.     </div><!--/.moview-details-wrap-->
  332.     <?php endwhile; ?>
  333. </section>
  334.  
  335. <?php get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement