<?php
function mostrar_ficha() {
if ( ! is_numeric( $_POST['post_id']))
die("Wrong ID!");
$_POST['post_id'] = abs(intval($_POST['post_id']));
if ( ! $_POST['post_id'] )
die("Wrong ID!");
if(isset($_POST['post_id'])){
global $post;
$post = get_post($_POST['post_id']);
if ($post!=null){
setup_postdata($post);
//aca lo que quieras mostrar en la ficha
?>
<div class="aue"></img></div>
<div id="cont-counter-head">
<div id="modal-window"><div class="close-modal">X</div></div>
<div id="counter-cont">
<div id="ocultar">X</div>
<div class="contenedor-1">
<div id="general">
<a href="<?php the_permalink(); ?>"> <h1><?php the_title(); ?></h1></a>
<p>
<?php $origin = get_post_meta(get_the_id(), 'origin', TRUE);echo ''.$origin;?><br />
<span id="small-inf-1">
<span class="gen"><?php echo get_the_term_list( $post->ID, 'genero', '', ', ', ' ' );?></span>
<span class="age"><?php echo get_the_term_list( $post->ID, 'edad', '', ', ', ' ' );?></span>
<span class="tim"><?php $time = get_post_meta(get_the_id(), 'time', TRUE); echo ''.$time;?></span>
<span class="year"><?php echo get_the_term_list( $post->ID, 'year', ' ', ', ', ' ' );?></span>
<br />
</span>
<span class="actr"><br /><?php echo get_the_term_list( $post->ID, 'actores_principales', '<strong>Actores Principales:</strong><br /> ', ', ', ' ' );?></span>
</p>
<p><?php $subtitle_post = get_post_meta(get_the_id(), 'subtitle_post', TRUE); echo ''.$subtitle_post; ?></p>
<p><a href="<?php the_permalink(); ?>"><i class="fa fa-info-circle"></i> Ir a detalles</a></p>
</div>
</div>
<div id="cont-head">
<div class="left"></div>
<div id="divi-cent"></div>
<div class="right">
<div id="cont-play">
<div class="pos-img"> <div id="play-1"class="play"><i class="fa fa-link"></i></div> </div>
<?php $em_mtbx_img0 = get_post_meta( $post->ID, '_em_mtbx_img0', true ); if($em_mtbx_img0 != '') { // Si existe el valor ?> <img src="<?php echo $em_mtbx_img0; ?>" alt="" /> <?php } ?>
</div>
<div id="down">
<span>
<i class="fa fa-angle-down"></i>
<i class="fa fa-angle-up"></i>
</span>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
die();
}
add_action('wp_ajax_mostrar_ficha', 'mostrar_ficha');
add_action('wp_ajax_nopriv_mostrar_ficha', 'mostrar_ficha');
?>