Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get Custom Posts
<?php
$args = array(
'numberposts' => 18,
'orderby' => 'post_date',
'post_type' => 'cartelera'
);
$posts = get_posts( $args );
if ( count( $posts ) > 0 ) :
?>
<div class="cinema">
<header>
<i>Cartelera de Cine</i>
</header>
<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>
<div class="description">
<div class="title"><?php the_title() ?></div>
<div class="schedule"><?php the_excerpt() ?></div>
</div>
</div>
<?php endforeach ?>
</div>
<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>
</div>
<div class="bottom">
<span class="title">Cine Granados</span>
</div>
</div>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment