Event not displaying on Tag page

Home Forums Calendar Products Events Calendar PRO Event not displaying on Tag page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1598510
    wpcodeus
    Participant

    Hey Modern Tribe,

    We are having a conflict with some code that is causing the events to not display on the blog Tag page. We are using a plugin called Custom Post Type UI and we wanted the custom post type to display on the blog Tag page as well. The code that was supplied in the knowledge base of Custom Post Type UI is the following:

    function my_cptui_add_post_types_to_archives( $query ) {
    // We do not want unintended consequences.
    if ( is_admin() || ! $query->is_main_query() ) {
    return;
    }

    if ( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) {
    $cptui_post_types = cptui_get_post_type_slugs();

    $query->set(
    ‘post_type’,
    array_merge(
    array( ‘post’ ),
    $cptui_post_types
    )
    );
    }
    }
    add_filter( ‘pre_get_posts’, ‘my_cptui_add_post_types_to_archives’ );

    However, when we use that function it is causing the Events not to display but the Custom Post Type is displaing properly. Do you have a quick fix that will modify that function to allow both to display on the Tag page? I have tried to look through your knowledge base but couldn’t find anything. This is the last piece of the puzzle so I am praying you guys have a fix!

    Thanks in advance!

    #1600016
    Sky
    Keymaster

    Hi there,

    Please note that we are limited in the amount of support we can provide for customizations such as this.

    From looking at the code, it seems that you are explicitly overriding the post types that enabled in the feed. I would just add “tribe_events” into the array that you are merging with the post types handled by the Post Type plugin.

    Basically, try array( 'post', 'tribe_events' ) instead of just ‘post’

    Hope that helps!

    Thanks,
    Sky

    #1616844
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Event not displaying on Tag page’ is closed to new replies.