Support

Account

Home Forums General Issues How to order by date field Reply To: How to order by date field

  • Use the code that Mathias suggested, and place your code after:

    if ( $the_query->have_posts() ) {
    		while ( $the_query->have_posts() ) {
    			
    			$the_query->the_post();

    you can break the php to place your html like this:

    if ( $the_query->have_posts() ) {
    		while ( $the_query->have_posts() ) {
    			
    			$the_query->the_post(); ?>
    
    <!-- your code here -->
    
            <?php } } else { ?>
    
    		<h2>Not Found</h2>
    
    	<?php //endif; ?>
    	<?php } ?>
    	<?php wp_reset_postdata(); ?>