• Hey,

    We’re using the CPT-onomies plugin to make our “Parties” post type a taxonomy. Here’s the plugin: https://www.ads-software.com/plugins/cpt-onomies/

    What I’d like to do is add the “Parties” (now a taxonomy) to Events Manager Pro. I’ve used this code which I found on https://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/ :

    function my_em_own_taxonomy_register(){
        register_taxonomy_for_object_type('party',EM_POST_TYPE_EVENT);
    }
    add_action('init','my_em_own_taxonomy_register',100);

    I’ve put this in my functions.php file – this adds the party taxonomy to Events, and saves the selected taxonomies.

    Now the problem I get is searching the event with shortcodes, I’ve used:

    <?php echo do_shortcode('[events_list limit="10" party="resonance-records-ibiza-2013" ]#_EVENTNAME[/events_list]'); ?>

    But this returns the no events message, even though their are events with the taxonomy selected.

    Any ideas on the issue here – is it a conflict between CPT-onomies and Events Manager? This is a really integral part of the development of my website and would really appreciate if there’s a way of getting this to work ??

    Thanks
    Russell

    https://www.ads-software.com/plugins/events-manager/

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

    (@angelo_nwl)

    Thread Starter akiraprise

    (@akiraprise)

    Hey,

    Thanks for suggestion – I had a look but as that’s part of a bigger tutorial I got a bit confused by how it would work by getting the data from the taxonomy.

    $term_list = wp_get_post_terms($post->ID, 'party', array("fields" => "all"));
    
    add_filter('em_events_get_default_search','my_em_styles_get_default_search',1,2);
    function my_em_styles_get_default_search($searches, $array){
    	if( !empty($array['party']) ){
    		$term_list = $array['party'];
    	}
    	return $searches;
    }

    I got as far as that, but I’m not sure if that will work or not, any ideas? ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding a custom taxonomy to EM with CPT-onomies’ is closed to new replies.