[Plugin: All-in-One Event Calendar] Events as Posts
-
Can someone please give me a step by step guide to make events show as posts so they are pulled to my index page.
I have seen the code below but can’t find where to put it –
function add_post_type_to_query( $q ) {
if ( /* Whatever conditions you want to be met to add post type */ ) {
if ( empty($q->query_vars[‘post_type’]) ) {
$q->query_vars[‘post_type’] = array(‘post’,’ai1ec_event’);
} elseif ( ‘any’ == $q->query_vars[‘post_type’] ) {
return;
} else {
$q->query_vars[‘post_type’] = (array)$q->query_vars[‘post_type’];
$q->query_vars[‘post_type’][] = ‘ai1ec_event’;
}
}
}
add_action( ‘pre_get_posts’, ‘add_post_type_to_query’ );Thanks for looking
https://www.ads-software.com/extend/plugins/all-in-one-event-calendar/
- The topic ‘[Plugin: All-in-One Event Calendar] Events as Posts’ is closed to new replies.