Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » [Plugin: Types – Custom Fields and Custom Post Types Management] Query events by date – custom field

  • Hi,
    I have a custom field ‘event-date’ and I would like to only upcoming events which has event-date>today. I tried a lot but not able to make the query, can you please help?

    This is my current query –
    query_posts(array( ‘post_type’ => ‘events’,’type’ => ‘party’ ));
    if ( have_posts() ) : while ( have_posts() ) : the_post();

    The query_posts is not accepting custom fields. I tried WP_Query but it’s not working either.

    Thanks,
    Mick

    http://wordpress.org/extend/plugins/types/

Viewing 1 replies (of 1 total)
  • Plugin Author Amir Helzer

    (@amirhelzer)

    Until someone else jumps in and explains how to do this in PHP, using the correct WordPress API functions, would you like to see how Views does this?

    Have a look at Views date filters:
    http://wp-types.com/documentation/user-guides/date-filters/

    Using Views, you would create a new View for the ‘events’ custom post type. Then, filter it according to upcoming events.

    We’re missing a feature to add date filtering according to values of custom fields of the current post. We’ll try to include that in the next Views release. Now, you can filter by fixed dates, or relative to the current date.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Types – Custom Fields and Custom Post Types Management] Query events by date – custom field’ is closed to new replies.