For a non-blogging project I’m working on I integrated WordPress into the website to use some of the functionality such as recent news and future dated events. I needed to display a list of future dated events with linked titles and the time left to the event in a sidebar. Similar to what you currently see in the WordPress Dashbord. I needed the post to display if the title permalink was clicked, but I didn’t want the post to display anywhere else such as categories or recent posts. WordPress by default does not allow the viewing of future dated posts.

Here’s how I created a fairly complete solution.

First I added the following code where I wanted the future dated events to display.
[php]
< ?php
$today = current_time('mysql', 1);
if ( $scheduled = $wpdb->get_results(”SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date_gmt > ‘$today’”) ) :
echo “