WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Template
Doesn't work with a Child Theme (6 posts)

  1. ghleor
    Member
    Posted 1 year ago #

    Thanks for this plugin. It is just that I need!!
    The issue I've found is that it can't read post templates from a child theme, because it doesn't find them.
    So, I have to work on parent theme, is there any way to solve this?
    I would like to work with childtheme because It is safest.
    Thank you very much!

    http://wordpress.org/extend/plugins/custom-post-template/

  2. 082net
    Member
    Posted 1 year ago #

    Add lines below to custom-post-templates.php:176 (version 1.5)

    $post_templates = array();
    
    		$files = (array) $theme->get_files( 'php', 1 );
    		// MOD START
    		if ( $theme->parent() )
    			$files += (array) $theme->parent()->get_files( 'php', 1 );
    		// MOD END
  3. ghleor
    Member
    Posted 1 year ago #

    Thank you very much!

  4. Mark Jansen
    Member
    Posted 1 year ago #

    I have the same issue. The fix 082net posted works, but is there a way to fix this in the theme? If I ever update this plugin, chances are I will lose this fix.

  5. indole
    Member
    Posted 1 year ago #

    You could submit a patch : )

  6. Social Response
    Member
    Posted 1 year ago #

    FYI Mine works fine in a child theme, I think it must depend on the Theme

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.