put a list of one post type in other post type to select from it and display selected item in second post type’s single page

I cannot create a complete solution here, because it’s kinda a ‘work for me for free’ question. I can (globally) tell you how to accomplish this. wp-admin –> courses CPT –> add a metabox ‘select teacher(s)’. Collect the teachers with get_posts(). Save the selected teachers as meta, use update_post_meta($course_post_id, ‘assigned_teachers’, $assigned_teachers) in metabox save function. … Read more

Custom Post Type single post type shown in theme single.php

OK, let’s try to find this filter in WP code… In wp-includes/template.php you can find this: function get_single_template() { $object = get_queried_object(); $templates = array(); if ( ! empty( $object->post_type ) ) { $template = get_page_template_slug( $object ); if ( $template && 0 === validate_file( $template ) ) { $templates[] = $template; } $name_decoded = … Read more