• Resolved vgraba

    (@vgraba)


    Hello,
    i have added the normal posts category to my events and locations as described here: https://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/
    When i link to the category slug, only normal post are shown but not the events that are connected to the same category are not visible. I tried it with Custom Post Type but every time only the normal post are in the list without the events from the same taxonomie. Can somebody help me with this? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Is the link between post types appearing correctly in admin?

    Thread Starter vgraba

    (@vgraba)

    Hello,
    i’m not sure if i understand your question correctly. After adding the custom post types in
    the admin the category links show up under events too. I don’t know which specific link between post types you mean. Thanks for helping.

    Thread Starter vgraba

    (@vgraba)

    Hello,
    found the problem. Wasn’t aware that by default the category pages on a WordPress site will only display the default ‘Posts’ post type. To display a custom post type like the event post type on the same category page as the default posts, you need to add code into theme’s functions.php:
    function add_custom_types_to_tax( $query ) {
    if( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) {
    // Get all your post types
    $post_types = get_post_types();
    $query->set( ‘post_type’, $post_types );
    return $query;
    }
    }
    add_filter( ‘pre_get_posts’, ‘add_custom_types_to_tax’ );

    So Events Manger was not the problem as i thought in first place.

    • This reply was modified 8 years, 3 months ago by vgraba.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘List Posts and Events of the same category’ is closed to new replies.