feed_content_type example

<?php /** * Atom Feed Template for displaying Atom Comments feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '" ?' . '>';

/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'atom-comments' );
?> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php bloginfo_rss( 'language' ); ?>" xmlns:thr="http://purl.org/syndication/thread/1.0" <?php         /** This action is documented in wp-includes/feed-atom.php */
        
<?php /** * Atom Feed Template for displaying Atom Posts feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';

/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'atom' );
?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="<?php bloginfo_rss( 'language' ); ?>"
/** * Filters whether to display the posts feed link. * * @since 4.4.0 * * @param bool $show Whether to display the posts feed link. Default true. */
    if ( apply_filters( 'feed_links_show_posts_feed', true ) ) {
        printf(
            '<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
            feed_content_type(),
            esc_attr( sprintf( $args['feedtitle']get_bloginfo( 'name' )$args['separator'] ) ),
            esc_url( get_feed_link() )
        );
    }

    /** * Filters whether to display the comments feed link. * * @since 4.4.0 * * @param bool $show Whether to display the comments feed link. Default true. */
<?php /** * RSS2 Feed Template for displaying RSS2 Posts feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';

/** * Fires between the xml and rss tags in a feed. * * @since 4.0.0 * * @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments', * 'rdf', 'atom', and 'atom-comments'. */
 elseif ( in_array( $status, array( 403, 500, 502, 503 ), true ) ) {
                $exit_required = true;
            }
        } elseif ( empty( $this->query_vars['feed'] ) ) {
            $headers['Content-Type'] = get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' );
        } else {
            // Set the correct content type for feeds.             $type = $this->query_vars['feed'];
            if ( 'feed' === $this->query_vars['feed'] ) {
                $type = get_default_feed();
            }
            $headers['Content-Type'] = feed_content_type( $type ) . '; charset=' . get_option( 'blog_charset' );

            // We're showing a feed, so WP is indeed the only thing that last changed.             if ( ! empty( $this->query_vars['withcomments'] )
                || str_contains( $this->query_vars['feed'], 'comments-' )
                || ( empty( $this->query_vars['withoutcomments'] )
                    && ( ! empty( $this->query_vars['p'] )
                        || ! empty( $this->query_vars['name'] )
                        || ! empty( $this->query_vars['page_id'] )
                        || ! empty( $this->query_vars['pagename'] )
                        || ! empty( $this->query_vars['attachment'] )
                        || ! empty( $this->query_vars['attachment_id'] )
                    )
<?php /** * RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'rss' ) . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; ?> <rss version="0.92"> <channel> <title><?php wp_title_rss(); ?></title> <link><?php bloginfo_rss( 'url' ); ?></link> <description><?php bloginfo_rss( 'description' ); ?></description> <lastBuildDate><?php echo get_feed_build_date( 'D, d M Y H:i:s +0000' ); ?></lastBuildDate> <docs>http://backend.userland.com/rss092</docs> <language><?php bloginfo_rss( 'language' ); ?></language>
<?php /** * RSS 1 RDF Feed Template for displaying RSS 1 Posts feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';

/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'rdf' );
?> <rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
<?php /** * RSS2 Feed Template for displaying RSS2 Comments feed. * * @package WordPress */

header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );

echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';

/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss_tag_pre', 'rss2-comments' );
?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
Home | Imprint | This part of the site doesn't use cookies.