Expose a custom field of a custom post type to the REST API

Modify your code as below: /********************************************** * Add featured video to REST API ***********************************************/ function add_featured_video_id() { register_rest_field( array(‘post’, ‘project’), ‘featured_video_id’, array( ‘get_callback’ => ‘get_featured_video_id’, ‘update_callback’ => null, ‘schema’ => null, ) ); } Visit here, for more details on method register_rest_field,

Adding custom post types to archive

The problem could be related to how you register the custom post type. Did you add the “taxonomies” argument in the register_post_type? If yes, is it a string? Try to convert it in an array of strings. See the the example below… register_post_type( ‘custom_post_type_slug’, array( ‘labels’ => array ( /* … */ ), ‘public’ => … Read more