I have now installed another and new wordpress sandbox that is not in the VPN network – so reachable from the outside. I get the following error message from the w3c-feed-validator:
This feed does not validate.
- Server returned HTTP Error 500: Internal Server Error [help]
- line 1, column 0: Undefined root element: error [help]<error>
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.
- “text/xml” media type is not specific enough [help]
I do not know where the error is.
Thats my rss-custom-feed-code:
<?php
/**
* Template Name: Custom RSS Template - myfeed
*/
$postCount = 5; // The number of posts to show in the feed
$posts = query_posts('showposts=' . $postCount);
header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
?>
<rss version="2.0"
xmlns:content="https://purl.org/rss/1.0/modules/content/"
xmlns:wfw="https://wellformedweb.org/CommentAPI/"
xmlns:dc="https://purl.org/dc/elements/1.1/"
xmlns:atom="https://www.w3.org/2005/Atom"
xmlns:sy="https://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
<?php do_action('rss2_ns'); ?>>
<channel>
<title><?php bloginfo_rss('name'); ?> - Feed</title>
<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
<link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss('description') ?></description>
<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
<language><?php echo get_option('rss_language'); ?></language>
<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
<?php do_action('rss2_head'); ?>
<?php while(have_posts()) : the_post(); ?>
<item>
<title><?php the_title_rss(); ?></title>
<link><?php the_permalink_rss(); ?></link>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php the_author(); ?></dc:creator>
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description><![CDATA[<?php the_excerpt_rss() ?&>></description>
<content:encoded><![CDATA[<?php the_excerpt_rss() ?&>></content:encoded>
<?php rss_enclosure(); ?>
<?php do_action('rss2_item'); ?>
</item>
<?php endwhile; ?>
</channel>
</rss>
-
This reply was modified 1 year, 9 months ago by f3rdal.