By robertcottrell on
I've tweaked the template.php in my theme so that every rss post has a constant title: The Browser. The line looks like this:
$output .= " <title>The Browser</title>\n";
But now I find that the feed won't validate, apparently because no link is being outputted for that title. Here's the line that produces the link (I think). How would I rewrite it so that it always links the post title to "http://thebrowser.com" ?
$output .= ' <link>'. check_url($link) ."</link>\n";
Comments
More output?
Can you post the full RSS output? Are you sure that you've correctly defined $link before you get to the second quoted line?
Matt Holford
more output here -- thanks!
Thanks. Trouble is, I don't know how much I don't know here. I stripped in the line of code that zbricoleur very kindly offered, but thereby crashed the site. Here's the function
Match the quotes
If you took zbricoleur's code verbatim, your problem is likely due to the single quote at the beginning of the string and double quote at the end.
Try
And see if the output is valid. If so, you may not be passing my_format_rss_item() the correct $link value in the first place.
Matt Holford
$output .= '
$output .= ' <link>http://thebrowser.com</link>\n";