本文整理汇总了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>
示例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>
示例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;
}
示例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
示例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
}
示例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>
//.........这里部分代码省略.........
示例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;
}
示例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>