Does anyone know what this error is about, Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/b/r/bbrian017/html/casinofiery/wp-content/themes/ClassicPoker/functions.php:8) in /home/content/b/b/r/bbrian017/html/casinofiery/wp-includes/pluggable.php on line 694 Code (markup): I get the error when I visit the website using www. but when I don't use the www. the error doesn't show up. Any advice?
My guess is that the script is trying to redirect or set a header when some output has been already been sent to the browser. What's in ClassicPoker/functions.php on line 8?
I personally didn't add anything to the functions.php I'm assuming it's an error from when this free template was designed? Anyone have a clue how to fix this? this is the functions.php file here, <?php function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) { global $wp_locale; $m = $mysqlstring; if ( empty( $m ) ) return false; if( 'G' == $dateformatstring ) { return gmmktime( (int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ), (int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 ) ); } $i = mktime( (int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ), (int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 ) ); if( 'U' == $dateformatstring ) return $i; if ( -1 == $i || false == $i ) $i = 0; if ( !empty( $wp_locale->month ) && !empty( $wp_locale->weekday ) && $translate ) { $datemonth = $wp_locale->get_month( date( 'm', $i ) ); $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); $dateweekday = $wp_locale->get_weekday( date( 'w', $i ) ); $dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday ); $datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) ); $datemeridiem_capital = $wp_locale->get_meridiem( date( 'A', $i ) ); $dateformatstring = ' ' . $dateformatstring; $dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring ); $dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring ); $dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring ); $dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring ); $dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring ); $dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring ); $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 ); } $j = @date( $dateformatstring, $i ); /* if ( !$j ) // for debug purposes echo $i." ".$mysqlstring; */ return $j; } function current_time( $type, $gmt = 0 ) { switch ( $type ) { case 'mysql': return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) ); break; case 'timestamp': return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600 ); break; } } function date_i18n( $dateformatstring, $unixtimestamp ) { global $wp_locale; $i = $unixtimestamp; if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { $datemonth = $wp_locale->get_month( date( 'm', $i ) ); $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); $dateweekday = $wp_locale->get_weekday( date( 'w', $i ) ); $dateweekday_abbrev = $wp_locale->get_weekday_abbrev( Code (markup): I'm at work and had to use notepad to show this code. So I'm not too sure where line 8 is but I'm pretty sure I have added it here!
Oh yes jestep is right on this: pluggable.php tries to redirect to the www-less URL. In order for this to get completely solved, you need to add rewrite rule in your htaccess that redirects www to www-less URL. RewriteCond %{HTTP_HOST} ^[url]www.casinofiery.com[/url] [NC] RewriteRule ^(.*)$ http://casinofiery.com/$1 [R=301] Code (markup):
oh jeepers what file do I add that too? RewriteCond %{HTTP_HOST} ^www.casinofiery.com [NC] RewriteRule ^(.*)$ http://casinofiery.com/$1 [R=301] Code (markup): P.S. I also get the error when I save or edit anything in the admin cp. the changes save but I still get this error!
I know I have issues with .htaccess access files using godaddy. I don't currently have one in my root folder do I simply create one
Can I create this .htaccess file using notepad? and if so what do I save it as all files and a .php? I'm a little confused sorry... RewriteEngine ON RewriteCond %{HTTP_HOST} ^[url]www.casinofiery.com[/url] [NC] RewriteRule ^(.*)$ http://casinofiery.com/$1 [R=301] Code (markup): Like that?