backdrop_movie($post_id, 'original') : ''; } // --- მორგებული ლინკები ტაქსონომიებისთვის (/filtermovs/) --- $genre_terms = get_the_terms($post_id, 'category'); $categories = ''; if (!empty($genre_terms) && !is_wp_error($genre_terms)) { $g_links = array(); foreach ($genre_terms as $term) { $custom_url = home_url('/filtermovs/?type=movies&genre=' . $term->slug); $g_links[] = '' . esc_html($term->name) . ''; } $categories = implode(', ', $g_links); } $year_terms = get_the_terms($post_id, 'annee'); $year = ''; if (!empty($year_terms) && !is_wp_error($year_terms)) { $y_links = array(); foreach ($year_terms as $term) { $year_val = trim($term->name); $custom_url = home_url('/filtermovs/?type=movies&year_from=' . $year_val . '&year_to=' . $year_val); $y_links[] = '' . esc_html($year_val) . ''; } $year = implode(', ', $y_links); } $country_terms = get_the_terms($post_id, 'country'); $country = ''; if (!empty($country_terms) && !is_wp_error($country_terms)) { $c_links = array(); foreach ($country_terms as $term) { $custom_url = home_url('/filtermovs/?type=movies&country=' . $term->slug); $c_links[] = '' . esc_html($term->name) . ''; } $country = implode(', ', $c_links); } $acf_poster = get_field('img', $post_id); $poster_url = ''; if (!empty($acf_poster)) { if (is_array($acf_poster)) { $poster_url = isset($acf_poster['url']) ? $acf_poster['url'] : ''; } elseif (is_numeric($acf_poster)) { $poster_url = wp_get_attachment_url($acf_poster); } else { $poster_url = $acf_poster; } } if (empty($poster_url)) { $poster_url = get_the_post_thumbnail_url($post_id, 'full'); } if (empty($poster_url)) { $poster_url = get_template_directory_uri() . '/dsvr300.png'; } // --- ფლეიერის პოსტერი პირდაპირ იღებს უკვე დამუშავებულ მთავარ ბექდროფს --- $player_custom_poster = $backdrop; // თუ ბექდროფი ცარიელია, ბოლო ვარიანტად მთავარ პოსტერს ჩასვამს if(empty($player_custom_poster)){ $player_custom_poster = $poster_url; } $trailer_url = get_post_meta($post_id, 'field_trailer', true); $original_title = get_post_meta($post_id, 'field_title', true); if(empty($original_title)) { $original_title = get_post_meta($post_id, 'original_title', true); } if(empty($original_title)) { $original_title = get_post_meta($post_id, 'original-title', true); } $loop = $data['loop']; $quality = get_post_meta($post_id, 'qualitymovs', true); $imdb = get_field('imdb', $post_id); $tmdb_rating = get_post_meta($post_id, 'rating', true); $like_vote = get_post_meta($post_id, 'like_flix', true) ?: 0; $unlike_vote = get_post_meta($post_id, 'unlike_flix', true) ?: 0; $links = $loop->tr_links_movies($post_id); $trailer = $loop->trailer($post_id); $online_links = !empty($links['online']) ? $links['online'] : array(); $enable_tab_lang = get_option('enable_tab_lang', false); $custom_mp4_video = get_post_meta($post_id, 'videoembed', true); $player_custom_poster = $backdrop; if(empty($player_custom_poster)){ $player_custom_poster = $poster_url; } ?>
0){ ?>
name : 'Lang'; $lnt = $lpl; } ?>

('.strip_tags($year).')'; } ?>

:

:

:

duration()){ ?>

: duration(); ?>

get_tags_sin()){ ?>

: get_tags_sin(); ?>

director()){ $director_html = trim($loop->director()); $directors = []; if (preg_match_all('/]*>.*?<\/a>/s', $director_html, $matches)) { $directors = $matches[0]; } else { $directors = explode(',', $director_html); $directors = array_map('trim', $directors); $directors = array_filter($directors); } if (!empty($directors)) { usort($directors, function($a, $b) { $textA = strip_tags($a); $textB = strip_tags($b); $geoA = preg_match('/[ა-ჰ]/u', $textA); $geoB = preg_match('/[ა-ჰ]/u', $textB); return ($geoB ? 1 : 0) - ($geoA ? 1 : 0); }); $first_director = $directors[0]; $rest_directors = array_slice($directors, 1); } ?>

:

IMDb
TMDB
'ids') ); $args = array( 'post_type' => 'movies', 'post_status' => 'publish', 'posts_per_page' => 15, 'orderby' => 'rand', 'post__not_in' => array($post_id), ); if (!empty($custom_taxterms) && !is_wp_error($custom_taxterms)) { $args['tax_query'] = array( array( 'taxonomy' => 'category', 'field' => 'id', 'terms' => $custom_taxterms ) ); } $the_query = new WP_Query( $args ); if ( ! $the_query->have_posts() ) { wp_reset_query(); $args = array( 'post_type' => 'movies', 'post_status' => 'publish', 'posts_per_page' => 15, 'orderby' => 'date', 'order' => 'DESC', 'post__not_in' => array($post_id), ); $the_query = new WP_Query( $args ); } if ( $the_query->have_posts() ) : wp_enqueue_style('swiper-css', 'https://unpkg.com/swiper/swiper-bundle.min.css', array(), '6.8.4'); $unique_id = 'movies-scroll-' . $post_id; ?>
have_posts() ) : $the_query->the_post(); $current_movie_id = get_the_ID(); $permalink = get_permalink(); $title = get_the_title(); $acf_poster = get_field('img', $current_movie_id); $poster_url = ''; if (!empty($acf_poster)) { if (is_array($acf_poster)) { $poster_url = isset($acf_poster['url']) ? $acf_poster['url'] : ''; } elseif (is_numeric($acf_poster)) { $poster_url = wp_get_attachment_url($acf_poster); } else { $poster_url = $acf_poster; } } if (empty($poster_url)) { $poster_url = get_the_post_thumbnail_url($current_movie_id, 'full'); } if (empty($poster_url)) { $poster_url = get_post_meta($current_movie_id, 'poster_url', true); } if (empty($poster_url)) { $poster_url = get_template_directory_uri() . '/dsvr300.png'; } $quality = get_field('qualitymovs', $current_movie_id); $annee_terms = get_the_terms($current_movie_id, 'annee'); $movie_year = ''; if (!empty($annee_terms) && !is_wp_error($annee_terms)) { $movie_year = $annee_terms[0]->name; } ?>