Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get Custom Posts
$args = array(
'numberposts' => 18,
'orderby' => 'post_date',
'post_type' => 'cartelera'
$posts = get_posts( $args );
if ( count( $posts ) > 0 ) :
<div class="cinema">
<i>Cartelera de Cine</i>
<div class="dynamicMovie">
<div id="dlCartelera">
<?php foreach( $posts as $post ) : ?>
<div class="cinema_row">
<div class="poster">
<?php if ( has_post_thumbnail() ) : ?>
<?php the_post_thumbnail( 'movie-poster' ) ?>
<?php else : ?>
<img src="<?php echo get_template_directory_uri(); ?>/images/movie_poster.jpg" alt="Movie Poster" />
<?php endif ?>
<div class="description">
<div class="title"><?php the_title() ?></div>
<div class="schedule"><?php the_excerpt() ?></div>
<?php endforeach ?>
<div class="dlNavMovie">&nbsp;</div>
<div class="dlArrowNavMovie">
<a href="#" class="prev">&lt;<i></i></a>
<a href="#" class="next">&gt;<i></i></a>
<div class="bottom">
<span class="title">Cine Granados</span>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment