Archive pages for Venues and Organizers

Home Forums Calendar Products Events Calendar PRO Archive pages for Venues and Organizers

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #992186
    media325
    Participant

    I’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?

    #992282
    Brian
    Member

    Hi,

    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

    Rewrite Rules Inspector

    To see what is happening when you visit your new archives.

    Cheers

    #992311
    media325
    Participant

    Brian. 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');  
        
    #992312
    Brian
    Member

    I 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!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Archive pages for Venues and Organizers’ is closed to new replies.