You should insert this code either into the functions.php file of the child theme or by using the CodeSnippet plugin available here: https://wordpress.org/plugins/code-snippets/
add_filter( 'register_post_type_args', 'soledad_template_post_type_args', 10, 2 );
function soledad_template_post_type_args( $args, $post_type ) {
if ( 'custom-post-template' === $post_type ) { $args['show_in_rest'] = true;
// Optionally customize the rest_base or rest_controller_class $args['rest_base'] = 'custom-post-template'; $args['rest_controller_class'] = 'WP_REST_Posts_Controller'; }
return $args; }
For this specific situation, please send me your WordPress admin account details through a PRIVATE message. I will then log in and make an effort to assist you in diagnosing and resolving this issue.
Hi,
You should insert this code either into the functions.php file of the child theme or by using the CodeSnippet plugin available here: https://wordpress.org/plugins/code-snippets/
Now you can get the post template data via this URL: https://yoursite.com/wp-json/wp/v2/custom-post-template/
Regards,
PenciDesign.
Hi,
For this specific situation, please send me your WordPress admin account details through a PRIVATE message. I will then log in and make an effort to assist you in diagnosing and resolving this issue.
Regards,
PenciDesign.