How do display gallery embedded to the custom post type

I think one good possibility is to add a endpoint to permalink for galleries and then check the template to include in the template_include filter: add_action(‘init’, function() { add_rewrite_endpoint( ‘gallery’, EP_PERMALINK ); }); add_filter( ‘template_include’, function($template) { if ( get_query_var( ‘gallery’ ) ) { return get_stylesheet_directory() . ‘/single-event-gallery.php’; } return $template; }); Now, create the … Read more

Exclude Custom Post Type from shared Custom Taxonomy

You could try using the terms_clauses filter function wpse156370_terms_clauses( $pieces, $taxonomies, $args ) { global $wpdb; $pieces[‘fields’] .= $wpdb->prepare( ‘, (SELECT COUNT(*) FROM ‘ . $wpdb->posts . ‘ p, ‘ . $wpdb->term_relationships . ‘ p_tr’ . ‘ WHERE p_tr.object_id = p.ID AND p_tr.term_taxonomy_id = tt.term_taxonomy_id’ . ‘ AND p.post_status = %s AND p.post_type = %s) … Read more

Query Event Posts by Date

You need type casting for custom fields event-start-date and event-end-date. Then it will compare with time() & date() value. You need to add ‘type’ => ‘DATE’, in your meta query args. So your meta query will be like this: switch ($print_type) { case ‘current’: $meta_quer_args = array( ‘relation’ => ‘AND’, array( ‘key’ => ‘event-start-date’, ‘value’ … Read more