Home › Forums › Calendar Products › Events Calendar PRO › Archive pages for Venues and Organizers
- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by
Brian.
-
AuthorPosts
-
July 31, 2015 at 9:45 am #992186
media325
ParticipantI’ve added this code that should allow archive page for both to the theme functions.php
//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' => 'organizer', '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' => 'venue', 'with_front' => false, ), 'supports' => array( 'title', ) ) ); } add_action( 'init', 'update_tribe_venue_post_type');Then created archive-venue.php and archive-organizer.php. Bringing up either of these pages gives me a 404 error. Have I enabled Archive pages correctly?
July 31, 2015 at 12:07 pm #992282Brian
MemberHi,
Thanks for using our plugins. I can try to help out, but I am limited in supporting them.
The coding looks like that should work.
Did you try resaving permalinks after adding the coding?
If that does not help you maybe to use a plugin such as the Rewrite Rules Inspector
To see what is happening when you visit your new archives.
Cheers
July 31, 2015 at 12:49 pm #992311media325
ParticipantBrian. Thanks that is a great tool. Saving the Permalinks and using the plugin pointed me to a typo that I had in the code.
Here is the updated code if anyone finds it usefull:
//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');July 31, 2015 at 12:52 pm #992312Brian
MemberI am glad to see you were able to figure it out.
I am going to go ahead and close this ticket. If you have a similar issue or another in the future, please do not hesitate to create a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Archive pages for Venues and Organizers’ is closed to new replies.
