WordPress.org

Support

Support » Plugins and Hacks » [BUG] $page_template and child templates

[BUG] $page_template and child templates

  • in inc/functions.php:

    if ( file_exists( TEMPLATEPATH . '/single-qafp_faqs.php') ) {
    			$page_template = TEMPLATEPATH . '/single-qafp_faqs.php';
            } elseif ( file_exists( TEMPLATEPATH . '/page.php') ) {
    			$page_template = TEMPLATEPATH . '/page.php';
    		} elseif ( file_exists( TEMPLATEPATH . '/single.php' )) {
    			$page_template = TEMPLATEPATH . '/single.php';
    		} else {
    			$page_template = TEMPLATEPATH . '/index.php';
    		}

    Should be:

    if ( file_exists( get_stylesheet_directory() . '/single-qafp_faqs.php') ) {
    			$page_template = get_stylesheet_directory() . '/single-qafp_faqs.php';
            } elseif ( file_exists( TEMPLATEPATH . '/single-qafp_faqs.php') ) {
    			$page_template = TEMPLATEPATH . '/single-qafp_faqs.php';
            } elseif ( file_exists( get_stylesheet_directory() . '/page.php') ) {
    			$page_template = get_stylesheet_directory() . '/page.php';
            } elseif ( file_exists( TEMPLATEPATH . '/page.php') ) {
    			$page_template = TEMPLATEPATH . '/page.php';
    		} elseif ( file_exists( get_stylesheet_directory() . '/single.php' )) {
    			$page_template = get_stylesheet_directory() . '/single.php';
    		} elseif ( file_exists( TEMPLATEPATH . '/single.php' )) {
    			$page_template = TEMPLATEPATH . '/single.php';
    		} elseif ( file_exists( get_stylesheet_directory() . '/index.php' )) {
    			$page_template = get_stylesheet_directory() . '/index.php';
    		} else {
    			$page_template = TEMPLATEPATH . '/index.php';
    		}

    https://wordpress.org/plugins/q-and-a-focus-plus-faq/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[BUG] $page_template and child templates’ is closed to new replies.