• Hi there,

    I am trying to do a future post query but am unsure how I would put a ‘sorry no gigs currently planned’ if no future gigs are present. This is what I am currently using for the query.

    <ul>
    	<?php
    	$my_query = new WP_Query('category_name=live-review&post_status=future&order=ASC');
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$do_not_duplicate = $post->ID;
    	?>
    	<li><?php the_time('l, M j, Y') ?>: <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    	</ul>
    
    	<?php endwhile;?>

    Thanks
    Karl

Viewing 2 replies - 1 through 2 (of 2 total)
  • you should be able to do a second half of the while loop or add an if statement in there to add that text.

    I’m not sure if the exact syntax of the code though so I can’t help with writing it.

    Thread Starter elyonline

    (@elyonline)

    Thanks for that, it is (indeed) the syntax for this I am struggling with. Is anyone able to give me a nod in the right direction please?

    Thank you
    Karl

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP_query problem’ is closed to new replies.