Wordpress Event list
Posted
by kwek-kwek
on Stack Overflow
See other posts from Stack Overflow
or by kwek-kwek
Published on 2010-05-05T16:26:27Z
Indexed on
2010/05/05
16:28 UTC
Read the original article
Hit count: 301
Hi I have followed a tutorial to create and event list in wordpress using post and Custom Fields view demo
here is my code:
<?php // Get today's date in the right format
$todaysDate = date('M d');
?>
<?php query_posts('showposts=5&category_name=events&meta_key=Date&meta_compare=>=&meta_value='.$todaysDate.'&orderby=meta_value=order=ASC'); ?>
<ul>
<?php
if (have_posts()) : while (have_posts()) : the_post();
$eventMeta = get_post_meta($post->ID, 'Date', true);
$eventDate = strtotime($eventMeta);
$displayDate = date ('M d', $eventDate);?>
<li>
<span class="date"><?php echo $displayDate ; ?></span>
<span><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span>
</li>
<?php endwhile; else: ?>
<li>Sorry, no upcoming events!</li>
<?php endif; ?>
</ul>
<?php wp_reset_query(); ?>
Now my problem is that it doesn't show any events for the future events e.g. (June, July etc. ...).
On one of the the discussion there someone had said about putting "In your query_posts, just use the parameter ‘post_status=future’ "
.
Can you please let me know exactly where? I have added it but nothing happened.
© Stack Overflow or respective owner