ive this s line all around wordpress dashboard since ive install the new 2.9 version
Warning: file(/home/stripper/public_html/celebquebec.com/wp-content/home/stripper/public_html/celebquebec.com/wp-content/themes/metro_10/index-3_columns.php) [function.file]: failed to open stream: No such file or directory in /home/stripper/public_html/celebquebec.com/wp-content/themes/metro_10/tools/post_templates.php on line 23
Warning: implode() [function.implode]: Invalid arguments passed in /home/stripper/public_html/celebquebec.com/wp-content/themes/metro_10/tools/post_templates.php on line 23
//This function scans the template files of the active theme,
//and returns an array of [Template Name => {file}.php]
if(!function_exists('get_post_templates')) {
function get_post_templates() {
$themes = get_themes(); //an array of all themes in the /themes directory
$theme = get_current_theme(); //the current, active theme
$templates = $themes[$theme]['Template Files']; //a list of all the current theme's template files
$page_templates = array ();
foreach ((array)$templates as $template ) { //this loop returns all the "post templates"
$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
$name = '';
if ( preg_match( '|Single Post Template:(.*)$|mi', $template_data, $name ) ) { $name = $name[1]; }
if ( !empty( $name ) ) { $post_templates[trim( $name )] = basename( $template ); }
}
return $post_templates; //return the array of Post Templates
}}