Can only replicate this one once or twice a day, fixing it only requires moving functions.php to a new name and back again in the shell (functions.php>func>functions.php). After that, site works fine for a few more hours till i come back and find http 500 error codes in the access log.
The site is not production so breaks are not a problem but i'd like to fix them of course. PHP error logging is turned on but nothing of any help is turning up in the logfile i have set.
I have tried to replicate the bug by pulling specific hooks but it does not seem to make a bit of difference.
Here is functions.php since it clearly seems to be the problem, we may be hooking some of these things incorrectly:
<?php
function childtheme_favicon() { ?>
<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico">
<?php }
add_action('wp_head', 'childtheme_favicon');
function remove_blogtitle() {
remove_action('thematic_header','thematic_blogtitle',3);
}
add_action('init', 'remove_blogtitle');
function macosrumors_blogtitle() { ?>
<div id="blog-title">
/" title="<?php bloginfo('name') ?>" rel="home"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/mosrnew.png">
<h1 class="blogtitle">Mac OS Rumors</h1>
</div>
<?php }
add_action('thematic_header','macosrumors_blogtitle',3);
function remove_brandingclose() {
remove_action('thematic_header','thematic_brandingclose',7);
}
add_action('init', 'remove_brandingclose');
function macosrumors_brandingclose() { ?>
<div id="Tips">Submit Tips:</div>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/gmail-32.png" alt="Submit by email">
<div id="FollowUs">Follow Mac OS Rumors:</div>
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/twitter-80x80.png" alt="Follow us">
/feed"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/feed-icon-50x50.png" alt="Subscribe">
</div><!-- #branding -->
<?php }
add_action('thematic_header','macosrumors_brandingclose',7);
function remove_access() {
remove_action('thematic_header','thematic_access',9);
}
add_action('init', 'remove_access');
function macosrumors_nav_menu() { ?>
<div id="access">
<ul class="sf-menu sf-js-enabled">
<?php
$articles = get_cat_id('articles');
wp_list_categories('title_li=&include=' . $articles);
?>
<?php
$aboutpage = get_page_by_title('About');
$aboutpageid = $aboutpage->ID;
$contactpage = get_page_by_title('Contact');
$contactpageid = $contactpage->ID;
$privacypage = get_page_by_title('Privacy');
$privacypageid = $privacypage->ID;
wp_page_menu('menu_class=menu&echo=true&include=' . $aboutpageid . "," . $contactpageid . "," . $privacypageid);
?>
<ul class="sf-menu sf-js-enabled"><li id="search-box">
<form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
<div>
<input type="hidden" name="cx" value="partner-pub-8554564026690663:kjchh3-n0ft" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="text" name="q" size="31" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
</div><!-- #access -->
<?php }
add_action('thematic_header','macosrumors_nav_menu');
function thematic_postheader() {
global $id, $post, $authordata;
if (is_single() || is_page()) {
$posttitle = '<h1 class="entry-title">' . get_the_title() . "</h1>\n";
} elseif (is_404()) {
$posttitle = '<h1 class="entry-title">' . __('Not Found', 'thematic') . "</h1>\n";
} else {
$posttitle = '<h2 class="entry-title"><a href="';
$posttitle .= get_permalink();
$posttitle .= '" title="';
$posttitle .= __('Permalink to ', 'thematic') . the_title_attribute('echo=0');
$posttitle .= '" rel="bookmark">';
$posttitle .= get_the_title();
$posttitle .= "</h2>\n";
}
$posttitle = apply_filters('thematic_postheader_posttitle',$posttitle);
$postmeta = '<div class="entry-meta">';
$postmeta .= '<span class="meta-prep meta-prep-author">' . __('By ', 'thematic') . '</span>';
$postmeta .= '<span class="author vcard">'. '<a class="url fn n" href="';
$postmeta .= get_author_link(false, $authordata->ID, $authordata->user_nicename);
$postmeta .= '" title="' . __('View all posts by ', 'thematic') . get_the_author() . '">';
$postmeta .= get_the_author();
$postmeta .= '</span><span class="meta-sep meta-sep-entry-date"> | </span>';
$postmeta .= '<span class="meta-prep meta-prep-entry-date">' . __('Published: ', 'thematic') . '</span>';
$postmeta .= '<span class="entry-date"><abbr class="published" title="';
$postmeta .= get_the_time(thematic_time_title()) . '">';
$postmeta .= get_the_time(thematic_time_display());
$postmeta .= '</abbr></span>';
$postmeta .= "</div><!-- .entry-meta -->\n";
$postmeta = apply_filters('thematic_postheader_postmeta',$postmeta);
if ($post->post_type == 'page' || is_404()) {
$postheader = $postmeta . $posttitle;
} else {
$postheader = $postmeta . $posttitle;
}
echo apply_filters( 'thematic_postheader', $postheader ); // Filter to override default post header
} // end thematic_postheader
//creates the content
function thematic_content() {
if (is_home() || is_front_page()) {
$content = 'full';
} elseif (is_single()) {
$content = 'full';
} elseif (is_tag()) {
$content = 'full';
} elseif (is_search()) {
$content = 'full';
} elseif (is_category()) {
$content = 'full';
} elseif (is_author()) {
$content = 'full';
} elseif (is_archive()) {
$content = 'full';
}
$content = apply_filters('thematic_content', $content);
if ( strtolower($content) == 'full' ) {
$post = get_the_content(more_text());
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]>', $post);
} elseif ( strtolower($content) == 'excerpt') {
$post = get_the_excerpt();
} elseif ( strtolower($content) == 'none') {
} else {
$post = get_the_content(more_text());
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]>', $post);
}
echo apply_filters('thematic_post', $post);
} // end thematic_content
?>