WP REST API fetch posts from post type

Just add the next parmater into the function register_post_type, it can be before ‘menu_position’parameter. ‘show_in_rest’ => true if you’re using a plugin to register your posttype you can use the next code: add_action( ‘init’, ‘add_anuncios_to_json_api’, 30 ); function add_anuncios_to_json_api(){ global $wp_post_types; $wp_post_types[‘anuncio’]->show_in_rest = true; } after that, you’ll be able to list your posts from … Read more