• Hi, I’m creating an event discovery website called http://www.loopr.mx/wp
    where I’m uploading events through a CSV database as posts.

    I am using the events manager plugin in order to have a form through which users can upload their events. The problem is all my site functionality is made to display posts as events and sort them by their categories.

    Is there a way to make the events created through this plugin display as posts? I have tried the setting display events as “posts” but its not doing what I want

    https://ww.wp.xz.cn/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry but can you give us more details about this please?

    Is there a way to make the events created through this plugin display as posts? I have tried the setting display events as “posts” but its not doing what I want

    Thread Starter patrobles

    (@patrobles)

    So with the event manager plugin I can create events. These can be collectively displayed in an event page, or as individual events.

    However, I already built all of my site’s functionality around displaying posts. Therefore I would like to save these event’s as individual posts so they can be displayed as posts in my website. Therefore mantaining all of the tag and category functionality that I already have in my site’s widgets

    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 3 replies - 1 through 3 (of 3 total)

The topic ‘Saving events as posts’ is closed to new replies.