Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_shortcode( 'themeum_all_movies', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'category' => 'themeumall',
- 'number' => '10',
- 'column' => '3',
- 'show_top' => 'yes',
- 'class' => '',
- ), $atts));
- global $post;
- $posts = 0;
- global $wpdb;
- $output = $args = $url_encode = $get_keyword = $get_keyword_raw = $get_genero_raw = $get_anio_final = $get_anio_inicio = $get_genero = $sp = '';
- $args2 = [];
- $generos = [];
- $genero = [];
- $generos_arr = [];
- $letras = range('a','z');
- $numeros = range('0','9');
- $keyword_arr = array_merge($letras, $numeros);
- //Todos los géneros
- //$generos = get_terms(array('taxonomy' => 'movie_cat', 'orderby' => 'name'));
- $term_ficcion = get_term_by('name', 'ficcion', 'movie_cat');
- $name_ficcion = $term_ficcion->name;
- $slug_ficcion = $term_ficcion->slug;
- $genero_ficcion["name"]= $name_ficcion;
- $genero_ficcion["slug"]= $slug_ficcion;
- array_push($generos, $genero_ficcion);
- $term_documental = get_term_by('name', 'documental', 'movie_cat');
- $name_documental = $term_documental->name;
- $slug_documental = $term_documental->slug;
- $genero_documental["name"]= $name_documental;
- $genero_documental["slug"]= $slug_documental;
- array_push($generos, $genero_documental);
- $term_animacion = get_term_by('name', 'animacion', 'movie_cat');
- $name_animacion = $term_animacion->name;
- $slug_animacion = $term_animacion->slug;
- $genero_animacion["name"]= $name_animacion;
- $genero_animacion["slug"]= $slug_animacion;
- array_push($generos, $genero_animacion);
- $alfabeticas = get_terms(array('taxonomy' => 'movie_alfabetica', 'orderby' => 'name'));
- $url = get_permalink();
- // FILTRO GÉNERO
- if(isset( $_GET['genero%5BO%5D']))
- $_GET['genero'] = $_GET['genero%5BO%5D'];
- if(isset( $_GET['genero%5B%5D']))
- $_GET['genero'] = $_GET['genero%5B%5D'];
- if(isset( $_GET['genero'])){
- if(is_array($_GET['genero'])){
- foreach ($_GET['genero'] as $g) {
- $get_genero .= "&genero=".$g;
- }
- }
- $get_genero_raw = $_GET['genero'];
- }
- /*
- $args_maximo = [
- 'post_type' => 'movie',
- 'post_status' => 'publish',
- 'meta_key' => 'themeum_anio_final',
- 'meta_type' => 'NUMERIC',
- 'orderby' => 'meta_value_num',
- 'order' => 'DESC',
- 'posts_per_page' => 1
- ];
- $args_minimo = [
- 'post_type' => 'movie',
- 'post_status' => 'publish',
- 'meta_key' => 'themeum_anio_final',
- 'meta_type' => 'NUMERIC',
- 'orderby' => 'meta_value_num',
- 'order' => 'ASC',
- 'posts_per_page' => 1
- ];
- $the_query = new WP_Query($args_maximo);
- $anio_maximo = get_post_meta($the_query->ID, 'themeum_anio_final', false);
- $the_query = new WP_Query($args_minimo);
- $anio_minimo = get_post_meta($the_query->ID, 'themeum_anio_final', false);
- echo "<pre>";
- print_r(new WP_Query($args_minimo));
- echo "</pre>";
- var_dump(new WP_Query($args_maximo));
- ================================================================================
- global $wpdb;
- $query_string_anio_minimo = "SELECT MIN(meta_value) FROM cd_postmeta WHERE meta_key = 'themeum_anio_final'";
- $query_string_anio_maximo = "SELECT MAX(meta_value) FROM cd_postmeta WHERE meta_key = 'themeum_anio_final'";
- $anio_minimo = $wpdb->get_var($query_string_anio_minimo);
- $anio_maximo = $wpdb->get_var($query_string_anio_maximo);
- echo $anio_minimo;
- echo $anio_maximo;
- */
- // FILTRO AÑOS
- $get_anio_inicio_raw = 1900;
- $get_anio_final_raw = 2018;
- if(isset( $_GET['inicio']) && $_GET['inicio'] != "" ){
- $get_anio_inicio = '?inicio='.$_GET["inicio"];
- $get_anio_inicio_raw = $_GET["inicio"];
- }
- if(isset( $_GET['final'] ) && $_GET['inicio'] != "" ){
- $get_anio_final = '&final='.$_GET["final"];
- $get_anio_final_raw = $_GET["final"];
- }
- // FILTRO ALFABETICO nativo del tema MOVIEW
- if(isset( $_GET['keyword'] )){
- $get_keyword = '?keyword='.$_GET["keyword"];
- $get_keyword_raw = $_GET["keyword"];
- }
- $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
- // CONSULTA BÁSICA => obtiene todos los post de película ordenados por AÑO FINAL en orden descendente
- $args = array(
- 'post_type' => 'movie',
- 'post_status' => 'publish',
- 'posts_per_page' => esc_attr($number),
- 'meta_type' => 'NUMERIC',
- 'meta_key' => 'themeum_anio_final',
- 'orderby' => 'meta_value_num',
- 'order' => 'DESC',
- 'paged' => $paged
- );
- if($show_top == 'yes'){
- $output .= '<div class="moview-filters clearfix mb5">';
- $output .= '<div class="pull-left">';
- $output .= '<ul class="list-inline list-style-none">';
- $alphabate = array('TODAS','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','1','2','3','4','5','6','7','8','9');
- foreach ($alphabate as $value) {
- /*
- $sp = $get_genero.$get_anio_inicio.$get_anio_final;
- if (isset($get_anio_inicio_raw))
- if(isset($get_anio_final_raw) && isset($get_genero_raw))
- $sp = $get_anio_inicio.$get_anio_final.$get_genero;
- elseif (isset($get_anio_final_raw) && !isset($get_genero_raw))
- $sp = $get_anio_inicio.$get_anio_final;
- elseif (!isset($get_anio_final_raw) && isset($get_genero_raw))
- $sp = $get_anio_inicio.$get_genero;
- else
- if(isset($get_anio_final_raw) && isset($get_genero_raw))
- $sp = $get_anio_final.$get_genero;
- elseif (isset($get_anio_final_raw) && !isset($get_genero_raw))
- $sp = $get_anio_final;
- elseif (!isset($get_anio_final_raw) && isset($get_genero_raw))
- $sp = $get_genero;
- elseif (!isset($get_anio_final_raw) && !isset($get_genero_raw))
- $sp = '';
- if($sp == '')
- $sp = '?keyword='.$value;
- else
- $sp = '?keyword='.$value.$sp;
- */
- $sp = '?keyword='.$value;
- if( ($value=='TODAS') && ($get_keyword_raw == '') )
- $output .= '<li class="active" ><a href="'.$url.$sp.'">'.esc_attr($value).'</a></li>';
- else{
- if($get_keyword_raw == $value)
- $output .= '<li class="active" ><a href="'.$sp.'">'.esc_attr($value).'</a></li>';
- else
- $output .= '<li><a href="'.$url.$sp.'">'.esc_attr($value).'</a></li>';
- }
- }
- $output .= '</ul>';
- $output .= '</div>';
- $output .= '</div>';
- $output .= '<hr>';
- $output .= '<div class="filtro-cinedata">';
- $output .= '<form id="filtros" action="'.$url.'" method="GET">';
- /*
- if(isset($_GET['keyword']))
- $output .= '<input type="hidden" id="anio-inicio" name="keyword" value='.$_GET['keyword'].'>'; */
- /*
- //TODOS LOS GENEROS
- $output .= '<div id="generos">';
- $output .= '<label for="genero">Géneros</label>';
- if ( ! empty( $generos ) && !is_wp_error( $generos ) ){
- foreach ( $generos as $genero ) {
- $output .= '<input type="checkbox" name="genero[]" value="'.$genero->slug.'">'.$genero->name;
- }
- $output .= '<br>';
- }
- $output .= '</div>';
- */
- //GENEROS ESPECÍFICOS
- $output .= '<div id="generos">';
- $output .= '<label>Géneros:</label>';
- if ( ! empty( $generos ) && !is_wp_error( $generos ) ){
- if(isset( $_GET['genero'])){
- foreach ( $generos as $genero ) {
- if(in_array($genero['slug'], $_GET['genero'])){
- $output .= '<label for="'.$genero["slug"].'"><input type="checkbox" name="genero[]" id="'.$genero["slug"].'" value="'.$genero["slug"].'" checked>'.$genero["name"].'</label>';
- }else{
- $output .= '<label for="'.$genero["slug"].'"><input type="checkbox" name="genero[]" id="'.$genero["slug"].'" value="'.$genero["slug"].'">'.$genero["name"].'</label>';
- }
- }
- }else{
- foreach ( $generos as $genero ) {
- $output .= '<label for="'.$genero["slug"].'"><input type="checkbox" name="genero[]" id="'.$genero["slug"].'" value="'.$genero["slug"].'" checked>'.$genero["name"].'</label>';
- }
- }
- $output .= '<br>';
- }
- $output .= '</div>';
- // ANIO INICIO y ANIO FIN
- $output .= '<div id="anios">';
- $output .= '<label for=""><strong>Período:</strong></label>';
- $output .= '<input type="hidden" id="anio-inicio" name="inicio" value="'.$get_anio_inicio_raw.'">';
- $output .= '<input type="hidden" id="anio-final" name="final" value="'.$get_anio_final_raw.'">';
- $output .= '<input id="valores_rango" type="hidden" data-desde="'.$get_anio_inicio_raw.'" data-hasta="'.$get_anio_final_raw.'" class="slider-input range-slider anios" value="'.$get_anio_inicio_raw.','.$get_anio_final_raw.'"/>';
- $output .= '</div>';
- // DURACION
- $output .= '<div id="duracion">';
- $output .= '<label for="duracion"><strong>Duración:</strong></label>';
- $output .= '<select name="duracion" id="select-duracion">';
- //TODOS
- if(isset($_GET['duracion']) && $_GET['duracion'] == 'todos')
- $output .= '<option value="todos" selected="selected">Todos</option>';
- else
- $output .= '<option value="todos">Todos</option>';
- //LARGO
- if(isset($_GET['duracion']) && $_GET['duracion'] == 'corto')
- $output .= '<option value="corto" selected="selected">Corto (menos de 30 minutos)</option>';
- else
- $output .= '<option value="corto">Corto (menos de 30 minutos)</option>';
- //MEDIO
- if(isset($_GET['duracion']) && $_GET['duracion'] == 'medio')
- $output .= '<option value="medio" selected="selected">Medio (entre 30 y 60 minutos)</option>';
- else
- $output .= '<option value="medio">Medio (entre 30 y 60 minutos)</option>';
- //CORTO
- if(isset($_GET['duracion']) && $_GET['duracion'] == 'largo')
- $output .= '<option value="largo" selected="selected">Largo (más de 60 minutos)</option>';
- else
- $output .= '<option value="largo">Largo (más de 60 minutos)</option>';
- $output .= '</select>';
- $output .= '</div>';
- $output .= '<button id="btn_enviar" type="submit" class="btn mr20 ml10">Filtrar</button>';
- $output .= '<button class="btn invertido" type="button" id="limpiar-filtros">Limpiar filtros</button>';
- $output .= '</form>';
- $output .= '<hr>';
- $output .= '</div>';
- }
- if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != ""){
- //Si hay parametros para filtrar => reseteo argumentos de wp_query
- $args = array(
- 'post_type' => 'movie',
- 'post_status' => 'publish',
- 'posts_per_page' => esc_attr($number),
- 'meta_type' => 'NUMERIC',
- 'meta_key' => 'themeum_anio_final',
- 'orderby' => 'meta_value_num',
- 'order' => 'DESC',
- 'paged' => $paged
- );
- //PROCESO EL QUERYSTRING
- $query_exploded = explode('&', $_SERVER['QUERY_STRING']);
- $query_con_parametros = crear_querystring_filtro_peliculas($query_exploded);
- //FILTRO ALFABETICO
- if(isset($query_con_parametros['keyword']) && $query_con_parametros['keyword'] != ""){
- if($query_con_parametros['keyword'] != "TODAS"){
- $tax_query_args = array(
- array(
- 'taxonomy' => 'movie_alfabetica',
- 'field' => 'slug',
- 'terms' => $query_con_parametros['keyword']
- )
- );
- }elseif ($query_con_parametros['keyword'] == "TODAS") {
- $tax_query_args = array(
- array(
- 'taxonomy' => 'movie_alfabetica',
- 'field' => 'slug',
- 'terms' => $keyword_arr,
- 'operator' => 'IN'
- )
- );
- }
- $args2 = array(
- 'tax_query' => $tax_query_args
- );
- }
- //FILTRO POR GENERO, DURACION y AÑO
- else{
- //PROCESO LOS AÑOS
- if((isset($query_con_parametros['anios']['inicio']) && $query_con_parametros['anios']['inicio'] != "") && (isset($query_con_parametros['anios']['final']) && $query_con_parametros['anios']['final'] == "")){
- $meta_query = array(
- array(
- 'key' => 'themeum_anio_final',
- 'value' => $query_con_parametros['anios']['inicio'],
- 'compare' => '>=',
- 'type' => 'NUMERIC'
- )
- );
- }
- elseif((isset($query_con_parametros['anios']['inicio']) && $query_con_parametros['anios']['inicio'] == "") && (isset($query_con_parametros['anios']['final']) && $query_con_parametros['anios']['final'] != "")){
- $meta_query = array(
- array(
- 'key' => 'themeum_anio_final',
- 'value' => $query_con_parametros['anios']['final'],
- 'compare' => '<=',
- 'type' => 'NUMERIC'
- )
- );
- }
- elseif((isset($query_con_parametros['anios']['inicio']) && $query_con_parametros['anios']['inicio'] != "") && (isset($query_con_parametros['anios']['final']) && $query_con_parametros['anios']['final'] != "")){
- $meta_query = array(
- 'relation' => 'AND',
- array(
- 'key' => 'themeum_anio_final',
- 'value' => $query_con_parametros['anios']['inicio'],
- 'compare' => '>=',
- 'type' => 'NUMERIC'
- ),
- array(
- 'key' => 'themeum_anio_final',
- 'value' => $query_con_parametros['anios']['final'],
- 'compare' => '<=',
- 'type' => 'NUMERIC'
- )
- );
- }else{
- $meta_query = "";
- }
- if($meta_query != ""){
- $args2 = array(
- 'meta_query' => $meta_query,
- );
- }
- $args = array_merge( $args,$args2 );
- //PROCESO GENEROS Y AGREGO $generos_arr en el TAX_QUERY
- if(!empty($query_con_parametros['generos']) && (isset($query_con_parametros['duracion']) && $query_con_parametros['duracion'] != "todos" )){
- $generos_arr = $query_con_parametros['generos'];
- if((isset($query_con_parametros['duracion']) && $query_con_parametros['duracion'] == "corto")){
- $tax_query_args = array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'movie_cat',
- 'field' => 'slug',
- 'terms' => $generos_arr,
- 'operator' => 'IN',
- ),
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'corto'
- )
- );
- }
- elseif ((isset($query_con_parametros['duracion']) && $query_con_parametros['duracion'] == "medio")) {
- $tax_query_args = array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'movie_cat',
- 'field' => 'slug',
- 'terms' => $generos_arr,
- 'operator' => 'IN',
- ),
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'medio'
- )
- );
- }
- elseif ((isset($query_con_parametros['duracion']) && $query_con_parametros['duracion'] == "largo")) {
- $tax_query_args = array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'movie_cat',
- 'field' => 'slug',
- 'terms' => $generos_arr,
- 'operator' => 'IN',
- ),
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'largo'
- )
- );
- }
- }elseif (!empty($query_con_parametros['generos']) && (isset($query_con_parametros['duracion']) && $query_con_parametros['duracion'] == "todos" )) {
- $generos_arr = $query_con_parametros['generos'];
- $tax_query_args = array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => 'movie_cat',
- 'field' => 'slug',
- 'terms' => $generos_arr,
- 'operator' => 'IN'
- )
- );
- }elseif (empty($query_con_parametros['generos']) && $query_con_parametros['duracion'] != "todos" ) {
- if($query_con_parametros['duracion'] == "corto"){
- $tax_query_args = array(
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'corto'
- )
- );
- }
- elseif ($query_con_parametros['duracion'] == "medio") {
- $tax_query_args = array(
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'medio'
- )
- );
- }
- elseif ($query_con_parametros['duracion'] == "largo") {
- $tax_query_args = array(
- array(
- 'taxonomy' => 'movie_duracion',
- 'field' => 'slug',
- 'terms' => 'largo'
- )
- );
- }
- }
- if(isset($tax_query_args))
- $args2 = array(
- 'tax_query' => $tax_query_args
- );
- }
- $args = array_merge( $args,$args2 );
- }
- $posts = get_posts( $args );
- $cantidad_posts = count($posts);
- $the_query = new WP_Query( $args );
- $output .= '<div id="response"></div>';
- // The Loop
- if($cantidad_posts == 0)
- $output .= "<p>No existen películas que coincidan con el criterio de búsqueda seleccionado.</p>";
- else {
- if(isset($_GET['inicio']) || isset($_GET['final']) || isset($_GET['keyword']) || isset($_GET['duracion']) || isset($_GET['genero'])){
- $output .= "<p id='cantidad_filtrados'>Encontramos <b>".$the_query->found_posts."</b> títulos que coinciden con los criterios seleccionados :)</p>";
- }
- $output .= '<div class="clearfix"></div>';
- $output .= '<div class="moview-common-layout moview-celebrities-filters">';
- $x = 1;
- foreach ($posts as $key=>$mpost): setup_postdata($mpost);
- if( $x == 1 ){
- $output .= '<div class="row margin-bottom">';
- }
- $anio_finalizacion = get_post_meta($mpost->ID,'themeum_anio_final',true);
- $duracion = get_post_meta($mpost->ID,'themeum_duracion',true);
- $paises = get_post_meta($mpost->ID,'themeum_movie_pais_productor',true);
- $formato_exhibicion = get_post_meta($mpost->ID,'themeum_movie_formato_exhibicion',true);
- $output .= '<div class="item movies col-sm-6 col-md-'.$column.'">';
- $output .= '<a href="'.get_the_permalink($mpost->ID).'" class="over-link"></a>';
- $output .= '<div class="item-wrapper">';
- $output .= '<div class="movie-poster">';
- if(get_the_post_thumbnail($mpost->ID,'moview-profile')) {
- $output .= get_the_post_thumbnail($mpost->ID,'moview-profile-uncropped', array('class' => 'img-responsive'));
- } else {
- $output .= '<img src="/wp-content/uploads/2018/04/afiche-por-defecto.jpg">';
- }
- $output .= '</div>';//movie-poster
- $output .= '<div class="movie-details">';
- $output .= '<div class="movie-name">';
- $output .= '<h4 class="movie-title uppercase"><a href="'.get_the_permalink($mpost->ID).'">'.get_the_title($mpost->ID).'</a>';
- $output .= '<span class="acotacion"> ('.$anio_finalizacion.')</span>';
- $output .= '</h4>';
- /* No queremos el genero acá, sino más abajo
- if ($movie_type) {
- $output .= '<span class="tag">'.esc_attr($movie_type).'</span>';
- } */
- $output .= '</div>';//movie-name
- $output .= '<p class="movie-logline fontSizeSmall">';
- $output .= wp_trim_words( get_the_excerpt($mpost->ID), 40, '...' );
- $output .= '</p>';//movie-logline (agregado por nosotros)
- $output .= '<div class="contenedor-datos">';
- $output .= '<div class="info-item fontSizeSmall">';
- $output .= '<div class="sub-item">';
- $output .= '<strong class="title">Director:</strong>';
- $director = cd_obtener_nombres_por_idPelicula_metakey_rol($mpost->ID, 'themeum_movie_direccion', 'director');
- $output .= '<ul class="inline mb0">';
- if(isset($director[0]) && $director[0] != "")
- $output .= '<li>'.$director[0].'</li>';
- if(isset($director[1]) && $director[1] != "")
- $output .= '<li>'.$director[1].'</li>';
- if(isset($director[2]) && $director[2] != "")
- $output .= '<li>'.$director[2].'</li>';
- $output .= '</ul>';
- $output .= '</div>';
- $empresa_prod = cd_obtener_nombres_por_idPelicula_metakey_rol($mpost->ID, 'themeum_movie_direccion', 'empresa-productora');
- if(isset($empresa_prod) && !empty($empresa_prod) ){
- $output .= '<div class="sub-item">';
- $output .= '<strong class="title">Empresa Productora:</strong>';
- $output .= '<ul class="inline mb0">';
- if(isset($empresa_prod[0]) && $empresa_prod[0] != "")
- $output .= '<li>'.$empresa_prod[0].'</li>';
- if(isset($empresa_prod[1]) && $empresa_prod[1] != "")
- $output .= '<li>'.$empresa_prod[1].'</li>';
- if(isset($empresa_prod[2]) && $empresa_prod[2] != "")
- $output .= '<li>'.$empresa_prod[2].'</li>';
- $output .= '</ul>';
- $output .= '</div>';
- }
- $output .= '</div>';
- $protagonistas = cd_obtener_nombres_por_idPelicula_metakey_rol($mpost->ID, 'themeum_movie_direccion', 'elenco');
- if(isset($protagonistas) && !empty($protagonistas)){
- $output .= '<div class="protagonistas info-item fontSizeSmall">';
- $output .= '<strong class="title">Protagonistas:</strong>';
- $output .= '<ul class="inline mb0">';
- if(isset($protagonistas[0]) && $protagonistas[0] != "" )
- $output .= '<li>'.$protagonistas[0].'</li>';
- if(isset($protagonistas[1]) && $protagonistas[1] != "" )
- $output .= '<li>'.$protagonistas[1].'</li>';
- if(isset($protagonistas[2]) && $protagonistas[2] != "" )
- $output .= '<li>'.$protagonistas[2].'</li>';
- $output .= '</ul>';
- $output .= '</div>';
- }
- if($duracion || $paises || $formato_exhibicion){
- $output .= '<div class="info-item fontSizeSmall">';
- if($duracion){ $output .= '<span class="sub-item">'.$duracion.' min. </span>';}
- if($paises){ $output .= '<span class="sub-item">'.$paises.'</span>';}
- if($formato_exhibicion){ $output .= '<span class="sub-item">'.$formato_exhibicion.'</span>';}
- $output .= '</div>';
- }
- $output .= '<div class="info-item fontSizeSmall">';
- $generos_pelicula = get_the_terms($mpost->ID,'movie_cat');
- if(isset($generos_pelicula) && $generos_pelicula != ""){
- $output .= '<div class="sub-item">';
- $output .= '<strong class="title">Género:</strong>';
- $output .= '<ul class="inline mb0">';
- if(isset($generos_pelicula[0]->name) && $generos_pelicula[0]->name != "")
- $output .= '<li>'.$generos_pelicula[0]->name.'</li>';
- if(isset($generos_pelicula[1]->name) && $generos_pelicula[1]->name != "")
- $output .= '<li>'.$generos_pelicula[1]->name.'</li>';
- if(isset($generos_pelicula[2]->name) && $generos_pelicula[2]->name != "")
- $output .= '<li>'.$generos_pelicula[2]->name.'</li>';
- $output .= '</ul>';
- $output .= '</div>';
- }
- $output .= '</div>';
- $output .= '<div class="info-item fontSizeSmall">';
- $movie_color = get_post_meta($mpost->ID,'themeum_color',true);
- switch ($movie_color){
- case '0': $movie_color = 'Color';
- break;
- case '1': $movie_color = 'Blanco y Negro';
- break;
- case '2': $movie_color = 'Color / Blanco y Negro';
- break;
- }
- if(isset($movie_color) && $movie_color != ""){
- $output .= '<div class="sub-item">';
- $output .= '<strong class="title">Color o ByN:</strong>';
- $output .= '<ul class="inline mb0">';
- $output .= '<li>'.$movie_color.'</li>';
- $output .= '</ul>';
- $output .= '</div>';
- }
- $output .= '</div>';
- $output .= '</div>'; /* cierra .contanedor-datos */
- $output .= '<a class="ver-mas" href="'.get_the_permalink($mpost->ID).'">ver ficha</a>';
- $output .= '</div>';//movie-details
- $output .= '</div>';//item wrapper
- $output .= '</div>';//item
- if( $x == (12/$column) ){
- $output .= '</div>'; //row
- $x = 1;
- }else{
- $x++;
- }
- endforeach;
- $output .= '</div>';//spotlight-common
- if($x != 1 ){
- $output .= '</div>'; //row
- }
- wp_reset_postdata();
- // Total Post
- $args['posts_per_page'] = -1;
- $total_post = get_posts( $args );
- $var = $number;
- if( $var == "" || $var == 0 ){
- $total_post = 1;
- }else{
- $total_post = ceil( count($total_post)/(int)$var );
- }
- $output .= '<div class="themeum-pagination">';
- $big = 999999999; // need an unlikely integer
- $output .= paginate_links( array(
- 'type' => 'list',
- 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) )),
- 'format' => '?paged=%#%',
- 'current' => max( 1, get_query_var('paged') ),
- 'total' => $total_post
- ) );
- $output .= '</div>'; //pagination-in
- }
- return $output;
- });
- //Visual Composer
- if (class_exists('WPBakeryVisualComposerAbstract')) {
- vc_map(array(
- "name" => esc_html__("Latest Movies Listing", 'themeum-core'),
- "base" => "themeum_all_movies",
- 'icon' => 'icon-thm-video_post',
- "class" => "",
- "description" => esc_html__("Widget Movies Listing", 'themeum-core'),
- "category" => esc_html__('Moview', 'themeum-core'),
- "params" => array(
- /*
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Category Filter", 'themeum-core'),
- "param_name" => "category",
- "value" => themeum_cat_list('movie_cat'),
- ),
- */
- array(
- "type" => "textfield",
- "heading" => esc_html__("Number of items", 'themeum-core'),
- "param_name" => "number",
- "value" => "8",
- ),
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Number Of Column", "themeum-core"),
- "param_name" => "column",
- "value" => array('Select'=>'','column 2'=>'6','column 3'=>'4','column 4'=>'3'),
- ),
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Show Top Filter", 'themeum-core'),
- "param_name" => "show_top",
- "value" => array('Select'=>'','YES'=>'yes','NO'=>'no'),
- ),
- array(
- "type" => "dropdown",
- "heading" => esc_html__("OderBy", 'themeum-core'),
- "param_name" => "orderby",
- "value" => array('Select'=>'','Date'=>'date','Title'=>'title','Modified'=>'modified','Author'=>'author','Random'=>'rand'),
- ),
- array(
- "type" => "dropdown",
- "heading" => esc_html__("Order", 'themeum-core'),
- "param_name" => "order",
- "value" => array('Select'=>'','DESC'=>'DESC','ASC'=>'ASC'),
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Custom Class", 'themeum-core'),
- "param_name" => "class",
- "value" => "",
- ),
- )
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement