Forum Replies Created

Viewing 1 replies (of 1 total)
  • I’m not an expert but I believe these two additions to your theme’s functions.php might help you get started:

    // This should list events alongside regular posts with general queries
    add_filter( 'pre_get_posts', 'my_get_posts' );
    function my_get_posts( $query ) {
    	if ( !is_admin() && false == $query->query_vars['suppress_filters'] ) {
    		$query->set( 'post_type', array( 'post', 'event' ) );
    		}
    	return $query;
    }
    
    // This should add regular post taxonomy to Events and Locations
    function my_em_own_taxonomy_register(){
        register_taxonomy_for_object_type('category',EM_POST_TYPE_EVENT);
        register_taxonomy_for_object_type('category',EM_POST_TYPE_LOCATION);
        register_taxonomy_for_object_type('post_tag',EM_POST_TYPE_EVENT);
        register_taxonomy_for_object_type('post_tag',EM_POST_TYPE_LOCATION);
    }
    add_action('init','my_em_own_taxonomy_register',100);
Viewing 1 replies (of 1 total)