This plugin breaks my theme and I'm not quite knowledgeable enough to figure out why. I'll keep working on it because I really like the added functionality for my visitors. But it's a real pain right now.
This plugin breaks my theme and I'm not quite knowledgeable enough to figure out why. I'll keep working on it because I really like the added functionality for my visitors. But it's a real pain right now.
Oops - forgot to add a URL to the site. Powerstates.com. Try url http://powerstates.com/test to see the AA Google 404 page.
The plugin inserts its code within my theme's footer and I haven't figured out why yet or how to fix it. The coding looks correct, but it doesn't appear correct in a web browser. Still working at it - and posted a question at AskApache.
I had the same problem and tracked it down to an issue where the plugin processes its output twice if you have a 404 template.
Locate this block of code, somewhere around line 793 in askapache-google-404.php:
/**
* AAGoogle404Handler::handle_404()
*/
function handle_404()
{
//error_log(__FUNCTION__.':'.__LINE__);
global $wpdb, $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
if ( is_array($wp_query->query_vars) ) extract( $wp_query->query_vars, EXTR_SKIP );
ob_start();
@header( "HTTP/1.1 {$this->status_code} {$this->reason}", 1 );
@header( "Status: {$this->status_code} {$this->reason}", 1 );
if ( $this->status_code == 400 || $this->status_code == 403 || $this->status_code == 405 || (string )$this->status_code[0] == '5' ) return $this->handle_non_404();
if ( file_exists(TEMPLATEPATH . '/404.php') && is_file(TEMPLATEPATH . '/404.php') ) load_template( TEMPLATEPATH . '/404.php' );
else {
get_header();
$this->handle_it();
get_sidebar();
get_footer();
}
ob_flush(); flush();
}
You need to comment out the section that asks about whether you have a 404 template. So, your new function should look like this:
/**
* AAGoogle404Handler::handle_404()
*/
function handle_404()
{
//error_log(__FUNCTION__.':'.__LINE__);
global $wpdb, $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;
if ( is_array($wp_query->query_vars) ) extract( $wp_query->query_vars, EXTR_SKIP );
ob_start();
@header( "HTTP/1.1 {$this->status_code} {$this->reason}", 1 );
@header( "Status: {$this->status_code} {$this->reason}", 1 );
if ( $this->status_code == 400 || $this->status_code == 403 || $this->status_code == 405 || (string )$this->status_code[0] == '5' ) return $this->handle_non_404();
/*
if ( file_exists(TEMPLATEPATH . '/404.php') && is_file(TEMPLATEPATH . '/404.php') ) load_template( TEMPLATEPATH . '/404.php' );
else {
get_header();
$this->handle_it();
get_sidebar();
get_footer();
}
*/
ob_flush(); flush();
}dougvdotcom - many thanks for posting this. I was having the same problem and couldn't work out why.
This topic has been closed to new replies.