I’d like to know if it’d be possible to have events displaying in a category. I know there’s a calendar/map page layout, but I’d also like my users to be able to see the events in a list-style directly from our category “…com/category/events”.
I know that for another one of our plugin that add project-type posts, we had to add a custom function like :
function id_add_custom_types( $query ){
$project_cat = get_term_by(‘slug’, ‘projects’, ‘category’);
if( $project_cat && $query->is_main_query() && (‘projects’ == $query->query_vars[‘category_name’] || $project_cat->term_id == $query->query_vars[‘cat’]) ) {
$query->set(‘post_type’, array(‘post’,’ignition_product’));
}
}
add_filter( ‘pre_get_posts’, ‘id_add_custom_types’ );
Could you provide us with a similar function?
All best,
Bastien