How to Filter custom post type by taxonomy?

I believe you can add the following to the theme’s functions.php & visit /courses/?topics=foo,bar to get the results you’re looking for: <?php /** * Custom search-query with taxonomy filter */ function wpse373353_search_query( $wp_query ) { // exit early if this isn’t that main loop on the front-end of the site if ( ! $wp_query->is_main_query() || … Read more

Don’t know how to show custom taxonomies from a custom post_type

Ok, i did work for you: First, I registered custom post type and taxonomy: add_action(‘init’, ‘my_init’); add_action(‘admin_init’, ‘my_admin_init’); function my_admin_init() { $role = get_role( ‘administrator’ ); $role->add_cap( ‘edit_event’ ); $role->add_cap( ‘read_event’ ); $role->add_cap( ‘delete_event’ ); $role->add_cap( ‘edit_events’ ); $role->add_cap( ‘read_events’ ); $role->add_cap( ‘delete_events’ ); $role->add_cap( ‘edit_others_events’ ); $role->add_cap( ‘publish_events’ ); $role->add_cap( ‘read_private_events’ ); $role->add_cap( ‘delete_private_events’ … Read more

Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together

After a lot of inspection of rewrites happening under the hood by hooking into filters and logging variable values, I managed to solve the problem! Queries and query rewriting When a query occurs, WordPress will serve the content using the correct template as soon as it has enough info to unambiguously determine what the template … Read more