Ask your WordPress questions! Pay money and get answers fast! (more info)

Show Future Custom Post Type WordPress

  • SOLVED

I need to distinct the events that are past date and the ones that are coming.
How will be distinct, maybe adding a class to the div of the loop, not really sure but I can add the special content after, what I need now is the code that works doing it.

Answers (2)

2014-12-04

Arnav Joy answers:

you can try following :-


<?php
if( have_posts()) :while( have_posts()) :the_post();


if ( get_post_status ( get_the_ID() ) == 'future' ) {

$class = 'future-post';
}

else
$class = '';

?>
<div class="<?php echo $class;?>">
.....
.....
</div>
<?php

endwhile;
endif;
?>

2014-12-04

S├ębastien | French WordpressDesigner answers:

if(strtotime($post->post_date) >= strtotime(date('d/m/Y'))
{
}