Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Show Event category posts in main blog loop

Home / Forums / Virtue Theme / Show Event category posts in main blog loop

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
November 3, 2014 at 8:23 pm

Hi Ben

I’m using the blog grid and want to show custom posts in there (tribe_events)

I am using the following code, but when I add this to functions, although it does now indeed display my events in the blog section, I find the navigation bar has disappeared from the page on category pages. Can you suggest a better alternative?

add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if(is_archive() || is_tag() || is_home() && empty( $query->query_vars['suppress_filters'] ) ) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('post','tribe_events','attachment');
$query->set('post_type',$post_type);
return $query;
}
}

  • The forum ‘Virtue Theme’ is closed to new topics and replies.