WPMUDEV Events+ Plugin

Nov, 23, 2016 by

If you are like me, I like to streamline stuff.

I had posed the question if it was possible for the Events+ plugin to share categories and tags as other custom post types do with regular posts.

The answer I had gotten was no, and it is not possible out of the box.

I understood that that it might require some coding, and I am no expert, no novice, but also not afraid to try.

What I found was you CAN!

In your functions.php, add the following code:

function wpa_categories_for_events(){
register_taxonomy_for_object_type( 'category', 'incsub_event' );
add_action( 'init', 'wpa_categories_for_events' );

function wpa_tags_for_events(){
register_taxonomy_for_object_type( 'post_tag', 'incsub_event' );
add_action( 'init', 'wpa_tags_for_events' );

This unfortunately adds two versions of categories, and 2 Tags to your Events. One set are custom “Event-Tags” and Event-Categories” The other set are normal WordPress tags and categories that resolve from your normal posts or other WordPress custom post types.

I will add another Blog post on how to disable the Out-Of-The-Box Categories and Tags that the WPMUDEV.org WordPress Events+ Plugin comes with.

But for now, this code should help you!

Tags: , , ,

Categorized as the following:

Services we provide

Graphic Design

The art or skill of combining text and pictures in advertisements, magazines, or books. We take pride in being a Detroit Graphic Designer

Search Engine Optimization

Using meaningful content is a very important part of ethical SEO methods. Users (and Google), demand relevant information from their searches.

WordPress Development

1 in 4 websites are designed in WordPress. We use Foundation 6 or Bootstrap 4 frameworks and only develop responsive websites