Пример #1
0
/**
 * Chooses which template to display for the content context
 * 
 * @param string $content Used in filtering and default if no template file can be found
 * @return mixed Path to the file, false if no file exists
 * 
**/
function cfct_choose_content_template($type = 'content')
{
    $files = cfct_files(CFCT_PATH . $type);
    $filename = cfct_choose_single_template($files);
    if (!$filename && cfct_context() == 'page' && file_exists(CFCT_PATH . $type . '/page.php')) {
        $filename = 'page.php';
    }
    if (!$filename) {
        $filename = cfct_default_file($type);
    }
    return apply_filters('cfct_choose_content_template', $filename, $type);
}
Пример #2
0
function cfct_choose_content_template_default($type = 'content')
{
    $context = cfct_context();
    return cfct_filename($type, $context);
}