• Resolved mrcangrejero

    (@mrcangrejero)


    By following a tutorial at Udemy, I came up with a custom theme that, as far as I’m concerned, works beautifully. So, this post is basically a wish-list inquiry. The theme has three custom templates that show all right in the Template Dropdown in Page Editor. They also work all right.

    When I created a child theme for it, I copied and modified those custom templates to conform to the needs of the child theme, and they also work all right, mostly.

    What I’ve tried to accomplish to no avail, is to exclude from the child theme’s Template Dropdown in Page Editor some, not all, of the parent’s templates. I would really appreciate any guidance in achieving this. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello mrcangrejero,

    Please add the below code in your child theme function.php file which will helps you to remove parent theme templates in your child theme.

    add_filter( 'theme_page_templates', 'my_remove_page_template' );
        function my_remove_page_template( $pages_templates ) {
        unset( $pages_templates['your-template-name.php'] );
        return $pages_templates;
    }

    Thanks

    Thread Starter mrcangrejero

    (@mrcangrejero)

    To Clarion Technologies
    This worked like a charm. Can’t tell you enough how much I appreciate the guidance. The best to you, guys!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Template Dropdown In Page Editor: Child Theme’ is closed to new replies.