COMMIT! Fix for the function check_child_theme

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-11-06 14:52:13 -08:00
parent 2d7e8dc881
commit 8ba7e351ea
4 changed files with 8 additions and 16 deletions

View File

@ -1,12 +1,5 @@
<?php <?php
// Run this when a theme is switched to revert the navigation to default
function comicpress_on_theme_switch() {
update_option('comicpress-graphicnav_directory', 'default');
}
add_action('switch_theme','comicpress_on_theme_switch',1,10);
// Queue up the scripts. // Queue up the scripts.
wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js'); wp_enqueue_script('comicpress_scroll', get_template_directory_uri() . '/js/scroll.js');
@ -858,9 +851,11 @@ function cp_copyright() {
function comicpress_check_child_file($filename = '') { function comicpress_check_child_file($filename = '') {
if (empty($filename)) return false; if (empty($filename)) return false;
if (file_exists(get_stylesheet_directory() .'/'. $filename . '.php')) { if (get_stylesheet_directory() != get_template_directory()) {
@require_once(get_stylesheet_directory() .'/'. $filename . '.php'); if (file_exists(get_stylesheet_directory() .'/'. $filename . '.php')) {
return true; @require_once(get_stylesheet_directory() .'/'. $filename . '.php');
return true;
}
} }
return false; return false;
} }

View File

@ -1,9 +1,5 @@
<?php if (comicpress_check_child_file('layout-head') == false) { ?> <?php if (comicpress_check_child_file('layout-head') == false) { ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="header-<?php the_ID(); ?>"></div>
<?php endwhile; endif; ?>
<div id="content-wrapper-head"></div> <div id="content-wrapper-head"></div>
<div id="content-wrapper"> <div id="content-wrapper">

View File

@ -1,3 +1,5 @@
<?php if (comicpress_is_active_sidebar('Header')) { ?>
<div id="sidebar-header" class="customsidebar <?php global $enable_if_widgetarea_use_sidebar_css; if ($enable_widgetarea_use_sidebar_css == 'yes') { ?> sidebar<?php } ?>"> <div id="sidebar-header" class="customsidebar <?php global $enable_if_widgetarea_use_sidebar_css; if ($enable_widgetarea_use_sidebar_css == 'yes') { ?> sidebar<?php } ?>">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header') ) : ?><?php endif; ?> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header') ) : ?><?php endif; ?>
</div> </div>
<?php } ?>

View File

@ -1,6 +1,5 @@
<?php global $disable_lrsidebars_frontpage; <?php global $disable_lrsidebars_frontpage;
if ($disable_lrsidebars_frontpage == 'yes' && is_home()) { if ($disable_lrsidebars_frontpage != 'yes') { ?>
} else { ?>
<div id="sidebar-right"> <div id="sidebar-right">
<div class="sidebar-head"></div> <div class="sidebar-head"></div>
<div class="sidebar"> <div class="sidebar">