Support » Plugin: Single Post Template » Not working with Child themes

  • A great idea however it does not work with child themes unless you put the single post template files directly into that child theme.

    I need the single post templates to be in the main themes folder and then be able to use that themes child theme and for the single post templates to then work with that child theme. When I have the child theme active the post templates are not accessible or visible on the post page. When I activate the main theme it then works.



Viewing 2 replies - 1 through 2 (of 2 total)
  • I was running into the same thing; it appears that the call to WP_Theme’s get_files() method on line 51 of post_templates.php omits the third argument, $search_parent, which instructs WordPress to scan the parent theme as well as the child. The following patch should fix it for you:

    Change the following (line 51 on post_templates.php)…
    $templates = wp_get_theme()->get_files( 'php', 1 );

    $templates = wp_get_theme()->get_files( 'php', 1, true );

    I’ve also opened a pull request with this change on Github.

    Thank you 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not working with Child themes’ is closed to new replies.