Event organiser incompatible with "post type => any"?

WordPress Event Management, Calendars & Registration Forums General Question Event organiser incompatible with "post type => any"?

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 11 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4971

    Hey Stephen,

    First of all thank you very much for making this excellent plugin and well done!

    I’ve just noticed that since your latest update, a certain functionality has stopped working on my site. I have a featured content slider on my homepage that pulls in posts and pages listed under a category I called featured. The query also pulls in events from your plugin. I used a tax query to pull in this data and set the post-type to ‘any’. Now in version 1.7.3 of Event Organiser this worked swimmingly with both types of content being pulled in, but since the latest update, only the events show up in my slider (not the featured posts/pages).

    Here is my query as it used to work when using event organiser v1.7.3:

    $args=array(
    'post_type' => 'any',
    'showposts' => $featured_num,
    'order' => 'DESC',
    'tax_query' => array(
    'relation' => 'OR',
    array(
    'taxonomy' => 'category',
    'field' => 'slug',
    'terms' => 'featured'
    ),
    array(
    'taxonomy' => 'event-category',
    'field' => 'slug',
    'terms' => 'featured-event'
    )
    )
    );
    $my_query = new WP_Query($args);

    I’ve racked my brains for 2 days trying to understand why but to no avail, and have temporarily reverted to using the old 1.7.3 version instead of the latest release.

    If I change the post type to:

    'post-type' => array('page','post')

    I get my featured posts and pages, but lose out on displaying the events. And if I change it to ‘post-type’ => ‘any’ or:

    'post-type' => array('page','post','event')

    I only get the event posts.

    Any help would be greatly appreciated!

    Thanks!

    Haret
    #4981

    Hi Haret,

    Yes a change was made in 1.8 to improve query handling – the idea being that events could be registered to an arbitrary custom taxonomy and the changes allowed event dates to be available…

    … unfortunately this introduced a bug regarding cross-post-type queries. I’ll be fixing this in 1.8.3, though you may need to specifically set group_events_by, to series.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.