Home › Forums › Calendar Products › Events Calendar PRO › Archive templates for Venues and Organizes
- This topic has 4 replies, 3 voices, and was last updated 10 years, 7 months ago by
Support Droid.
-
AuthorPosts
-
August 2, 2015 at 5:41 am #992549
media325
ParticipantBy adding the code below to my theme function file I was able to allow archives for venues and organizers.
However the archive-tribe_organizer.php and archive-tribe_venue.php template pages aren’t being called. The archives continue to load the index.php page. Have I missed something?
//re-register tribe_organizer to allow for archive pages function update_tribe_organizer_post_type() { register_post_type('tribe_organizer', array( 'labels' => array ( ), 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'organizers', 'with_front' => false, ), 'supports' => array( 'title', ) ) ); } add_action( 'init', 'update_tribe_organizer_post_type'); //re-register tribe_venue to allow for archive pages function update_tribe_venue_post_type() { register_post_type('tribe_venue', array( 'labels' => array ( ), 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'venues', 'with_front' => false, ), 'supports' => array( 'title', ) ) ); } add_action( 'init', 'update_tribe_venue_post_type');August 3, 2015 at 11:06 am #992802Geoff
MemberHey @media325! Nice to see you again and hope all is well. 🙂
Good question. Your functions are totally legit and on point. The issue is that our own template selector class Tribe__Events__Templates::templateChooser() intentionally overrides has_archive in order to allow the selection of a specific template in other views.
This is completely untested, but you could try doing something like this to achieve the same effect:
add_filter( 'template_include', 'custom_venue_template', 20 ); function custom_venue_template( $template ) { if ( ! is_singular() || ! tribe_is_venue() ) return $template; return 'custom/template/path.php'; }Like I said, it hasn’t been tried out, but should at least give you a good framework to start with.
Let me know if you have any other follow-up questions here and I’d be happy to help as best I can. 🙂
Cheers!
GeoffAugust 4, 2015 at 9:53 am #993168media325
ParticipantGeoff
Thank you. Can you expand uponintentionally overrides has_archive in order to allow the selection of a specific template in other views.
I don’t want to interfere with core features or effect the Modern Tribe Plugins. Thanks
August 4, 2015 at 11:47 am #993198Geoff
MemberGood question! We specifically declare a different template for events and organizers than what would be used in the traditional WordPress hierarchy. Using the sort of structure in the snippet I provided would only have an impact on the Venue views and wouldn’t interfere with any of the plugin’s other functionality–you should be safe as far as that goes. 🙂
Cheers!
GeoffAugust 19, 2015 at 7:05 am #997191Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Archive templates for Venues and Organizes’ is closed to new replies.
