get_feed_link example

// Intentional fall-through to be handled by the 'url' case.         case 'url':
            $output = home_url();
            break;
        case 'wpurl':
            $output = site_url();
            break;
        case 'description':
            $output = get_option( 'blogdescription' );
            break;
        case 'rdf_url':
            $output = get_feed_link( 'rdf' );
            break;
        case 'rss_url':
            $output = get_feed_link( 'rss' );
            break;
        case 'rss2_url':
            $output = get_feed_link( 'rss2' );
            break;
        case 'atom_url':
            $output = get_feed_link( 'atom' );
            break;
        case 'comments_atom_url':
            
/** * Displays the permalink for the feed type. * * @since 3.0.0 * * @param string $anchor The link's anchor text. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). */
function the_feed_link( $anchor$feed = '' ) {
    $link = '<a href="' . esc_url( get_feed_link( $feed ) ) . '">' . $anchor . '</a>';

    /** * Filters the feed link anchor tag. * * @since 3.0.0 * * @param string $link The complete anchor tag for a feed link. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */
    echo apply_filters( 'the_feed_link', $link$feed );
}
 elseif ( is_feed() && 'old' === $feed ) {
                $old_feed_files = array(
                    'wp-atom.php'         => 'atom',
                    'wp-commentsrss2.php' => 'comments_rss2',
                    'wp-feed.php'         => $default_feed,
                    'wp-rdf.php'          => 'rdf',
                    'wp-rss.php'          => 'rss2',
                    'wp-rss2.php'         => 'rss2',
                );

                if ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) {
                    $redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] );

                    wp_redirect( $redirect_url, 301 );
                    die();
                }
            }

            if ( $paged > 0 ) {
                $redirect['query'] = remove_query_arg( 'paged', $redirect['query'] );

                if ( ! is_feed() ) {
                    if ( ! is_single() ) {
                        
Home | Imprint | This part of the site doesn't use cookies.