Support

Home Forums Event Espresso Premium Event category dropdown on pages in admin

Event category dropdown on pages in admin

Posted: July 20, 2015 at 6:21 am

Viewing 3 reply threads


Damian Way

July 20, 2015 at 6:21 am

Hi there,

I want to be able to use the event categories on the normal pages within WordPress and wondered what would be the best way of setting this up?

I want to be able to select a category then use the category slug for a plugin that I have developed for that page. The plugin is for a widget that displays the current categories events which works fine, I just want a better way than using the pages categories as this will be duplicating the event categories that I already have.

I am guessing I either need to create a new plugin or create some functions for my themes functions.php file but would like some pointers if possible?

Thanks

Damian


Dean

July 20, 2015 at 6:33 am

You could try:

add_action('init','add_categories_to_cpt');
function add_categories_to_cpt(){
    register_taxonomy_for_object_type('espresso_event_categories', 'post');
}

Props to Pippin: https://pippinsplugins.com/add-already-registered-taxonomy/


Damian Way

July 20, 2015 at 6:45 am

Hi Dean,

Thanks for getting back to me so quickly, that works really well thank you.

Damian


Dean

July 20, 2015 at 6:46 am

You’re welcome!

Viewing 3 reply threads

The support post ‘Event category dropdown on pages in admin’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso