Future Posts on a page?
-
Hi everyone,
Have been doing some searching in regards to making a list of upcoming events. Been looking at full calendar solutions but for now just making a post and editing the date and time is fine. I found a snippet of code:
*************
<?php
/*
Plugin Name: The Future is Now!
Description: Display posts with a timestamp in the future.
Version: R1.0.1
*/
function show_future_where($where) {
global $wpdb;
if( !is_single() && !is_page() )
$where .= ” OR $wpdb->posts.post_status = ‘future’ “;
return $where;
}
add_filter(‘posts_where’, ‘show_future_where’);
?>
**********
I’m running php-exec and put this on a page called events(imagine that). Should I be putting this on a template instead? Haven’t tried making a template yet on my own.Any help would be great!
- The topic ‘Future Posts on a page?’ is closed to new replies.