当前位置: 首页>>代码示例>>PHP>>正文


PHP rss_enclosure函数代码示例

本文整理汇总了PHP中rss_enclosure函数的典型用法代码示例。如果您正苦于以下问题:PHP rss_enclosure函数的具体用法?PHP rss_enclosure怎么用?PHP rss_enclosure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rss_enclosure函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: esc_url

        }
        ?>

<?php 
    }
    ?>

		<wfw:commentRss><?php 
    echo esc_url(get_post_comments_feed_link(null, 'rss2'));
    ?>
</wfw:commentRss>
		<slash:comments><?php 
    echo get_comments_number();
    ?>
</slash:comments>
<?php 
    rss_enclosure();
    ?>

	<?php 
    do_action('rss2_item');
    ?>

	</item>
	<?php 
}
?>

</channel>
</rss>
开发者ID:grff-alpha,项目名称:grff-alpha-web,代码行数:30,代码来源:feed-rss2.php

示例2: bloginfo_rss

	<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
	<language><?php echo get_option('rss_language'); ?></language>
	<?php do_action('rss2_head'); ?>
	<?php while( have_posts()) : the_post(); ?>
	<item>
		<title><?php the_title_rss() ?></title>
		<link><?php permalink_single_rss() ?></link>
		<comments><?php comments_link(); ?></comments>
		<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>
		<?php the_category_rss() ?>

		<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php else : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
	<?php if ( strlen( $post->post_content ) > 0 ) : ?>
		<content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
	<?php else : ?>
		<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
	<?php endif; ?>
<?php endif; ?>
		<wfw:commentRss><?php echo comments_rss(); ?></wfw:commentRss>
<?php rss_enclosure(); ?>
	<?php do_action('rss2_item'); ?>
	</item>
	<?php endwhile; ?>
</channel>
</rss>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:30,代码来源:wp-rss2.php

示例3: bbp_display_topics_feed_rss2


//.........这里部分代码省略.........
</link>
		<description><?php 
    //
    ?>
</description>
		<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
    ?>
</pubDate>
		<generator>http://bbpress.org/?v=<?php 
    bbp_version();
    ?>
</generator>
		<language><?php 
    bloginfo_rss('language');
    ?>
</language>

		<?php 
    do_action('bbp_feed_head');
    ?>

		<?php 
    if (bbp_has_topics($topics_query)) {
        ?>

			<?php 
        while (bbp_topics()) {
            bbp_the_topic();
            ?>

				<item>
					<guid><?php 
            bbp_topic_permalink();
            ?>
</guid>
					<title><![CDATA[<?php 
            bbp_topic_title();
            ?>
]]></title>
					<link><?php 
            bbp_topic_permalink();
            ?>
</link>
					<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_meta(bbp_get_topic_id(), '_bbp_last_active_time', true));
            ?>
</pubDate>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>

					<?php 
            if (!post_password_required()) {
                ?>

					<description>
						<![CDATA[
						<p><?php 
                printf(esc_html__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
                ?>
</p>
						<?php 
                bbp_topic_content();
                ?>
						]]>
					</description>

					<?php 
                rss_enclosure();
                ?>

					<?php 
            }
            ?>

					<?php 
            do_action('bbp_feed_item');
            ?>

				</item>

				<?php 
        }
        ?>
			<?php 
    }
    ?>

		<?php 
    do_action('bbp_feed_footer');
    ?>

	</channel>
	</rss>

<?php 
    exit;
}
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:101,代码来源:functions.php

示例4: bbp_display_replies_feed_rss2


//.........这里部分代码省略.........
                bbp_topic_permalink();
                ?>
</guid>
						<title><![CDATA[<?php 
                bbp_topic_title();
                ?>
]]></title>
						<link><?php 
                bbp_topic_permalink();
                ?>
</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>

						<description>
							<![CDATA[
							<p><?php 
                printf(__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
                ?>
</p>
							<?php 
                bbp_topic_content();
                ?>
							]]>
						</description>

						<?php 
                rss_enclosure();
                ?>

						<?php 
                do_action('bbp_feed_item');
                ?>

					</item>

				<?php 
            }
            ?>
			<?php 
        }
        ?>
		<?php 
    }
    ?>

		<?php 
    if (bbp_has_replies($replies_query)) {
        ?>
			<?php 
        while (bbp_replies()) {
            bbp_the_reply();
            ?>

				<item>
					<guid><?php 
            bbp_reply_url();
            ?>
</guid>
					<title><![CDATA[<?php 
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:67,代码来源:functions.php

示例5: gwolle_gb_rss


//.........这里部分代码省略.........
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		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/"
		xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		<?php 
    do_action('rss2_ns');
    ?>
>

		<channel>
			<title><?php 
    bloginfo_rss('name');
    echo " - " . __('Guestbook Feed', GWOLLE_GB_TEXTDOMAIN);
    ?>
</title>
			<atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
			<link><?php 
    echo $permalink;
    ?>
</link>
			<description><?php 
    bloginfo_rss('description');
    echo " - " . __('Guestbook Feed', GWOLLE_GB_TEXTDOMAIN);
    ?>
</description>
			<lastBuildDate><?php 
    echo $lastbuild;
    ?>
</lastBuildDate>
			<language><?php 
    echo $WPLANG;
    ?>
</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 
    if (is_array($entries) && !empty($entries)) {
        foreach ($entries as $entry) {
            ?>
					<item>
						<title><?php 
            _e('Guestbook Entry by', GWOLLE_GB_TEXTDOMAIN);
            echo " " . trim($entry->get_author_name());
            ?>
</title>
						<link><?php 
            echo $permalink;
            ?>
</link>
						<pubDate><?php 
            echo gmdate('D, d M Y H:i:s', $entry->get_datetime());
            ?>
</pubDate>
						<dc:creator><?php 
            echo trim($entry->get_author_name());
            ?>
</dc:creator>
						<guid isPermaLink="false"><?php 
            echo $permalink;
            ?>
</guid>
						<description><![CDATA[<?php 
            echo wp_trim_words($entry->get_content(), 12, '...');
            ?>
]]></description>
						<content:encoded><![CDATA[<?php 
            echo wp_trim_words($entry->get_content(), 25, '...');
            ?>
]]></content:encoded>
						<?php 
            rss_enclosure();
            ?>
						<?php 
            do_action('rss2_item');
            ?>
					</item>
					<?php 
        }
    }
    ?>
		</channel>
	</rss>
	<?php 
}
开发者ID:kovacsa91,项目名称:gwolle-gb,代码行数:101,代码来源:rss.php

示例6: draw_feed

function draw_feed($posts)
{
    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="http://purl.org/rss/1.0/modules/content/"
      xmlns:wfw="http://wellformedweb.org/CommentAPI/"
      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/"
      xmlns:slash="http://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 
    foreach ($posts as $post) {
        ?>
        <item>
          <title><?php 
        echo $post->post_title;
        ?>
</title>
          <?php 
        $datetime = new DateTime($post->post_date);
        $permalink = site_url() . $datetime->format('/Y/m/') . $post->post_name;
        ?>
          <link><?php 
        echo $permalink;
        ?>
</link>
          <pubDate><?php 
        echo $post->post_date;
        ?>
</pubDate>
          <dc:creator><?php 
        echo get_the_author_meta('display_name', $post->post_author);
        ?>
</dc:creator>
          <guid isPermaLink="false"><?php 
        echo $post->guid;
        ?>
</guid>
          <description><![CDATA[<?php 
        echo trim(strip_tags($post->post_content));
        ?>
]]></description>
          <content:encoded><![CDATA[<?php 
        trim(strip_tags($post->post_content));
        ?>
]]></content:encoded>
          <?php 
        rss_enclosure($post);
        ?>
          <?php 
        $thumbnail_size = apply_filters('rss_enclosure_image_size', 'large');
        $thumbnail_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($thumbnail_id, 'large');
        if ($thumbnail_id) {
            printf('<enclosure name="featured_image" url="%s" length="%s" type="%s" />', $thumbnail[0], filesize(path_join($upload_dir['basedir'], $thumbnail['path'])), get_post_mime_type($thumbnail_id));
        }
        ?>
        </item>
//.........这里部分代码省略.........
开发者ID:ActiveWebsite,项目名称:BoojPressPlugins,代码行数:101,代码来源:WpBooj.php

示例7: get_feed_xml


//.........这里部分代码省略.........
	<?php 
    do_action('rss2_head');
    foreach ($feed_items as $feed_item) {
        switch_to_blog($feed_item->blog_id);
        $post = get_post($feed_item->ID);
        setup_postdata($post);
        ?>
		
		<item>
			<title><?php 
        the_title_rss();
        ?>
</title>
			<link><?php 
        the_permalink_rss();
        ?>
</link>
			<comments><?php 
        comments_link_feed();
        ?>
</comments>
			<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>
			<?php 
        the_category_rss('rss2');
        ?>
			
			<guid isPermaLink="false"><?php 
        the_guid();
        ?>
</guid>
	<?php 
        if (get_option('rss_use_excerpt')) {
            ?>
			<description><![CDATA[<?php 
            the_excerpt_rss();
            ?>
]]></description>
	<?php 
        } else {
            ?>
			<description><![CDATA[<?php 
            the_excerpt_rss();
            ?>
]]></description>
		<?php 
            $content = \Inpsyde\MultisiteFeed\get_the_content_feed('rss2');
            ?>
		<?php 
            if (strlen($content) > 0) {
                ?>
			<content:encoded><![CDATA[<?php 
                echo $content;
                ?>
]]></content:encoded>
		<?php 
            } else {
                ?>
			<content:encoded><![CDATA[<?php 
                the_excerpt_rss();
                ?>
]]></content:encoded>
		<?php 
            }
            ?>
	<?php 
        }
        ?>
			<wfw:commentRss><?php 
        echo esc_url(get_post_comments_feed_link(NULL, 'rss2'));
        ?>
</wfw:commentRss>
			<slash:comments><?php 
        echo get_comments_number();
        ?>
</slash:comments>
	<?php 
        rss_enclosure();
        do_action('rss2_item');
        ?>
		</item>
		
		<?php 
        restore_current_blog();
    }
    ?>
	
</channel>
</rss>
<?php 
    $xml = ob_get_contents();
    ob_end_clean();
    return $xml;
}
开发者ID:alongtheway,项目名称:WP-Multisite-Feed,代码行数:101,代码来源:plugin.php

示例8: mp3_enclosure

    echo mp3_enclosure();
    ?>
</snippet>
                <description><![CDATA[<?php 
    echo the_content_feed();
    ?>
]]></description>
                <itunes:author><?php 
    the_author();
    ?>
</itunes:author>
                <itunes:subtitle><?php 
    the_excerpt_rss();
    ?>
</itunes:subtitle>
                <itunes:summary></itunes:summary>
                <itunes:image href="<?php 
    echo get_stylesheet_directory_uri();
    ?>
/images/show.jpg" />
            	
            	
            	<?php 
    echo rss_enclosure();
    ?>
            </item>
        <?php 
}
?>
    </channel>
</rss>
开发者ID:abegit,项目名称:bonobotunes,代码行数:31,代码来源:iosSlider.php


注:本文中的rss_enclosure函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。