Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $today = date('Ymd');
- $args = array(
- 'post_type' => 'upcoming-games',
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- 'no_found_rows' => true,
- //'update_post_term_cache' => false, // no taxonomy data
- 'post_per_page' => 9,
- // 'meta_query' => array(
- // array(
- // 'key' => 'end_date',
- // 'compare' => '>=',
- // 'value' => $today,
- // ),
- // array(
- // 'key' => 'start_date',
- // 'compare' => '<=',
- // 'value' => $today,
- // ))
- );
- $upcoming_games = new WP_Query( $args );
- ?>
- <div id="upcoming-games-sort" class="wrap">
- <div id="icon-upcoming-games-admin" class="icon32"></div>
- <div class="page-header">
- <h3><?php _e('Upcoming Games', 'wp-upcoming-games'); ?></h3>
- </div>
- <?php if ( $upcoming_games->have_posts() ) : ?>
- <p><?php _e( "Here's a list of some upcoming games coming out that we may play.", 'wp-upcoming-games' ); ?></p>
- <article id="upcoming-games-list">
- <?php while ( $upcoming_games->have_posts() ) : $upcoming_games->the_post(); ?>
- <div id="<?php the_id(); ?>" class="col-md-4">
- <?php if(has_post_thumbnail()) : ?>
- <div class="post-img">
- <?php the_post_thumbnail(); ?>
- </div>
- <?php endif; ?>
- <h4><?php the_title(); ?></h4>
- <?php
- $release_date = get_field( "release_date");
- // $release_date = new DateTime($release_date); ->format('j M Y')
- $publisher = get_field( "publisher" );
- $developer = get_field( "developer" );
- $youtube_link = get_field( "youtube_link" );
- $label_release_date = get_field_object($release_date);
- $tags = get_the_tags();
- $separator = ", ";
- $output = '';
- ?>
- <div class="upcoming-games-meta">
- <ul>
- <?php if( !empty ($release_date) ) echo '<li>' . '<span>' . $label_release_date . ': ' . '</span>' . $release_date . '</li>'; ?>
- <?php if( !empty ($publisher) ) echo '<li>' . $publisher . '</li>'; ?>
- <?php if( !empty ($developer) ) echo '<li>' . $developer . '</li>'; ?>
- <?php the_terms( $post->ID, 'genres', '', ', ' ); ?>
- <?php if( !empty ($youtube_link) ) echo '<li>' . '<a href="'. $youtube_link .'" target="_blank">' . 'Watch Trailer' . '</a>' . '</li>'; ?>
- </ul>
- </div>
- </div><!-- end upcoming game title -->
- <?php endwhile; ?>
- </article>
- <?php else : ?>
- <p><?php _e( "No Upcoming Games? Well this isn't right...", 'wp-upcoming-games' ); ?></p>
- <?php endif ?>
- </div>
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement