Smarter Navigation Breaking RSS Feed
-
I’m getting an error on my RSS feed page:
This page contains the following errors:
error on line 203 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.When I examine the code, I see this error being added at the end of the code, after the closing </rss> tag:
Warning: Cannot modify header information – headers already sent by (output started at /wp-includes/feed-rss2.php:11) in /wp-content/plugins/smarter-navigation/main.php on line 74
The relevant line in feed-rss2.php is:
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
And looking at the plugin, it looks like that block of code is:
public function set_cookie( $data = '' ) { $data = wp_parse_args( $data, array( 'query' => json_encode( $GLOBALS['wp_query']->query ), 'url' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'title' => trim( wp_title( self::SEP, false, 'left' ) ), ) ); foreach ( $data as $key => $value ) setcookie( self::get_name( $key ), $value, 0, '/' ); }
The setcookie line near the bottom is line 74. Is there a way to tell it to not try to set the cookie if it’s on the RSS page? Or is something else causing the problem? I know that blank lines at the beginning or end of files can cause these types of problems, but that doesn’t seem to be the issue in this case.
When I disable the Smarter Navigation plugin, the RSS works again.
I really love the Smarter Navigation plugin, but I need my RSS feed to work. Any help would be much appreciated!
Thanks.
- The topic ‘Smarter Navigation Breaking RSS Feed’ is closed to new replies.