Displaying Events in Search or Category or Taxonomy results pages

Home Forums Calendar Products Events Calendar PRO Displaying Events in Search or Category or Taxonomy results pages

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #14336
    Andy
    Member

    It seems Events are not listed in any search or category or taxonomy results pages. This seems to be a public/private setting which I can’t locate.

    I’ve searched the forums, but is there a simple response for:
    1) Displaying Events in taxonomy or search pages
    2) Limiting the Events in the search pages to only upcoming/future events (this one is not necessary, but would be nice to have this as a setting).

    Thanks in advance,
    Andy

    #14337
    Andy
    Member

    Detailing the above request…
    I’ve created global taxonomies which are used for events and posts. I’ve then created a template which dynamically lists all of the taxonomies used in either a post or event.

    Here, I’m using “bands” and “venues” as the taxonomy classes. http://six75.com/_cltmusic/bands-venues/

    The band or venue is only listed if used in a post or event. As you can see, only posts are displaying on the taxonomy results page. And most pages result in “no posts found” even though they are associated with an Event.

    Shouldn’t this be a simple private/public function that needs to be changed?

    #14461
    Rob
    Member

    Hi Andy. Thanks for reaching out here, and sorry that it took us a couple days to address this…somehow your post slipped through the cracks when we did our forum rounds yesterday. This is an interesting request that is a bit outside my area of expertise, but hopefully our dev Jonah would be able to respond. I’ve asked him to chime in directly this afternoon.

    #14488
    Jonah
    Participant

    Hi Andy,

    Events should be showing in search results unless you’ve excluded them some way or have a plugin doing this. Are you modifying the search in any way? What theme are you using?

    As for the category or taxonomy results pages, event categories are not setup as standard categories, they are taxonomies so should be showing in your taxonomy result pages for that specific taxonomy…

    You could try adding some additional query parameters to get only upcoming events in your search page by editing your search.php template with:


    query_posts(array( 'eventDisplay'=>'upcoming' ));

    Put that before the if(have_posts() bit…

    #20982
    Caleb
    Member

    Andy, did you ever figure out how to include events in the category results page?

    #21001
    Rob
    Member

    Did Jonah’s suggestion not do the trick in your situation, Caleb?

    #21044
    Caleb
    Member

    @Rob Nope. His response was to the second part of @Andy’s question.

    It’s not a huge deal, but I was trying to figure out if I can display posts and events with the same category/taxonomy. I don’t think it’s easily possible though.

    #21066
    Rob
    Member

    Ah, gotcha. Thanks for confirming. I’m pretty sure you’re correct as to the degree of difficulty here but let me get Jonah to give it a quick review just to be safe.

    #21081
    Jonah
    Participant

    Hey Caleb,

    The technique I provided back in January was a little outdated and in most all cases where you want to modify the query on any page you will want to use the pre_get_posts hook in WordPress. I would suggest looking at WordPress’ documentation on this: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts

    One example of this in action is this Gist to exclude a category from the calendar page: https://gist.github.com/2142161 – you could pretty easily modify this to add or change the condition to check if you are on the category results page and pass in post_type query params to bring in event posts with the ‘tribe_events’ post type.

    Does that help?
    – Jonah

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Displaying Events in Search or Category or Taxonomy results pages’ is closed to new replies.