Display custom post type by custom field date range
I’ve been struggling with this for days now and I’ve tried using various plugins etc but nothing seems to work.
I am storing events as custom post types and I have a custom field that stores the event date in YYY-mm-dd format. Each event also has a taxonomy assigned to it.
I have managed to display my custom posts by taxonomy but I need to display the posts by taxonomy within a certain date range.
For example display all events that have a taxonomy of ‘mountain bike’ and are taking place in April.
This is the code I have so far for the taxonomy part… can anyone advise what I need to do to include the custom date field for the date range part.
<?php query_posts( array( 'post_type' => 'event', 'event-category' => 'bmx racing' 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'ASC', ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- The topic ‘Display custom post type by custom field date range’ is closed to new replies.