Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3512468
Post template
Closed

Comments

  •   tarzo_content started the conversation
  •  2,610
    PenciDesign replied

    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/

    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;
    }

    Now you can get the post template data via this URL: https://yoursite.com/wp-json/wp/v2/custom-post-template/

    Regards,
    PenciDesign.



  •   tarzo_content replied privately
  •  2,610
    PenciDesign replied

    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.