Last active
August 29, 2015 14:01
-
-
Save theukedge/f8281e32acbf03ce89d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // IN THE SPOTLIGHT QUERY | |
if( false === ( $its_query = get_transient( 'its_query' ) ) ) { | |
$pttimestamp = time() + get_option('gmt_offset') * 60*60; | |
$its_query = new WP_Query( array( | |
'post_type' => 'spotlight', | |
'posts_per_page' => 1, | |
'meta_query' => array( | |
array( | |
'key' => '_hpc_spotlight_end_time', | |
'value' => $pttimestamp, | |
'compare' => '>' | |
) | |
) | |
) ); | |
set_transient( 'its_query', $its_query, 60*60*4 ); | |
} | |
if( have_posts() ) { // HIDE SECTION IF NO CURRENT ITS FEATURE ?> | |
// LOOP OUTPUT | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment