Created
January 2, 2013 05:53
-
-
Save DrewAPicture/4432542 to your computer and use it in GitHub Desktop.
Video query transient. The HOUR_IN_SECONDS constant is available in 3.5+, otherwise you can just use something like 60*60
This file contains hidden or 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 | |
$query = get_transient( 'video_query' ); | |
if ( false == $query ) { | |
$query = new WP_Query( $args ); | |
set_transient( 'video_query', $query, HOUR_IN_SECONDS ); | |
} | |
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); | |
... | |
endwhile; endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment