Home › Forums › Calendar Products › Events Calendar PRO › Organizer Archive Page (similar to Venue Archive Page)
- This topic has 11 replies, 2 voices, and was last updated 13 years, 3 months ago by
Barry.
-
AuthorPosts
-
December 13, 2012 at 6:04 pm #29461
Will
Participanthello all!
I saw a post a few seconds ago detailing adding a list of upcoming events on a single organizer page. Cool beans. However, by default, I’m not seeing an archive page for Organizer. Is this theoretically as easy as creating an archive-tribe_organizer.php?Had a look here, but didn’t see anything on it. https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/#templates
December 14, 2012 at 7:39 am #29481Barry
MemberTheoretically, except that archives are not enabled for the organizer post type. If you change that facet then it should work.
December 14, 2012 at 2:52 pm #29538Will
ParticipantAt some point elsewhere on the web I found a function someone posted to filter or adjust the Organizer Post Type. I’ll search for that again—I’d prefer to alter the plugin code as little as possible—but it would definitely help to enable the archives for Organizer, as that is a direct request from my client and a major piece of the functionality of this site. Worst case scenario is I just build my own wp_query on a page, that will work just fine too.
December 14, 2012 at 3:12 pm #29543Barry
MemberYep, you should be able to change that property (of the organizer post type I mean) … could be worth a quick skim through the Codex.
December 14, 2012 at 3:15 pm #29545Will
ParticipantYep, somewhere near the register_post_type function I’m sure is an ability to “update_post_type” or something to that effect. I’ll give it a read/search.
December 28, 2012 at 2:44 pm #30085Will
ParticipantJust to update this for anyone else looking for this, it IS possible to update the tribe_organizer post type using register_post_type in your functions.php. As per the WP codex, register_post_type is used to “create or modify a post type”.
I uploaded an example out of a project I’m working on now here: http://pastebin.com/HzMGiXiF
—That sets up an archive page for tribe_organizer, rewrites that path to /organizer/ and adds the ability to control the title (and thus the slug) of the organizer post type.However, please note that this will not automatically create a neat archive page like the events/single-venue.php creates. Unfortunately, that’s a little bit out of my scope, as for my own project, I just need that page to mimic the events/list.php, except with a custom wp_query to show all events that the selected organizer is attached to (which should be easy enough).
However, to give you a headstart, you’ll need to create a template file in your main child theme folder (not in the /events/ subfolder) called single-tribe_organizer.php, as per the WP Codex on custom post type templates. That will automatically be used when any single organizer is loaded in.
From there it should be a matter of mimicking the existing single-venue.php html and styles, and just swapping out the information displayed for organizer specific info.
I’ll post back in a bit with the custom wp_query to use to display events associated with the organizer. First, though, I need to go get some ice cream. 😉
December 28, 2012 at 2:45 pm #30086Will
ParticipantI should have posted the link to the WP Codex for templates above, but since I didn’t, I’ll do it here: http://codex.wordpress.org/Post_Type_Templates
December 31, 2012 at 8:34 am #30112Barry
MemberThanks for updating the thread with your solution (so far), Will. We’ll leave this open a little longer in the event there’s anything else you want to add. Cheers!
December 31, 2012 at 10:33 am #30124Will
ParticipantYep, I got distracted and haven’t put together the query for this page to make it similar to the venues page, if you don’t mind leaving it open that long, it may serve someone else trying to do something similar. Thanks! Happy New Year!
December 31, 2012 at 11:03 am #30129Barry
MemberAbsolutely, and a happy new year to you too 🙂
January 2, 2013 at 5:14 pm #30220Will
ParticipantJust to follow up, as I keep forgetting about this: in my single-tribe_organizer.php file, I reset the loop with this query_post() to grab events that belonged to the organizer page I’m on:
Using that, as well as some other customizations, theoretically you could recreate an organizer page similar to the venue single page.
January 4, 2013 at 8:15 am #30299Barry
MemberCool 🙂
-
AuthorPosts
- The topic ‘Organizer Archive Page (similar to Venue Archive Page)’ is closed to new replies.
