taxonomy.php problem with a WP_Query
-
I am building an Event section for a website, and using custom taxonomies to sort the events list (by “country” and “martial arts styles”).
The query does it job in ordering the envents by “event date” and not by “published date” for the main list ‘index (called “agenda.php”). But when you click on a “taxonomy term”, the query doesn’t filter as on the “agenda.php”. I got a “taxonomy.php” template file in which I pasted the same loop than on the “agenda.php”. The posts display, but not in the right order.
Here’s my loop:
<?php
$todaysDate = date('d/m/Y');
$agendaloop = new WP_Query('post_type=agenda&posts_per_page=10&meta_key=_date&meta_compare=>=&meta_value=$todaysDate&orderby=meta_value&order=ASC');
?>
<?php while ( $agendaloop->have_posts() ) : $agendaloop->the_post(); ?>[stuff here…]
<?php endwhile; ?>
Is there anybody who can figure out why the query doesn’t affect “taxonomy.php”?
- The topic ‘taxonomy.php problem with a WP_Query’ is closed to new replies.