本文整理汇总了PHP中comments_link_feed函数的典型用法代码示例。如果您正苦于以下问题:PHP comments_link_feed函数的具体用法?PHP comments_link_feed怎么用?PHP comments_link_feed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comments_link_feed函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
<?php
while (have_posts()) {
the_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');
?>
示例2: ent2ncr
?>
>
<title type="text"><?php
if ( is_singular() )
printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() );
elseif ( is_search() )
printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
else
printf( ent2ncr( __( 'Comments for %s' ) ), get_bloginfo_rss( 'name' ) . get_wp_title_rss() );
?></title>
<subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>
<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT'), false); ?></updated>
<?php if ( is_singular() ) { ?>
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php comments_link_feed(); ?>" />
<link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?>" />
<id><?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?></id>
<?php } elseif(is_search()) { ?>
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" />
<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
<id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
<?php } else { ?>
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url'); ?>" />
<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
<id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?>
<?php
/**
* Fires at the end of the Atom comment feed header.
*
示例3: get_feed_xml
/**
* Return XML for full feed.
*
* @param array $feed_items Array of objects. Required attributes: ID (=post id), blog_id
* @return string
*/
function get_feed_xml($feed_items)
{
global $post;
$rss_language = Settings\get_site_option('language_slug');
if (empty($rss_language) && defined('WPLANG')) {
$rss_language = substr(WPLANG, 0, 2);
}
ob_start();
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
echo get_feed_title();
?>
</title>
<atom:link href="<?php
echo get_feed_url();
?>
" rel="self" type="application/rss+xml" />
<link><?php
echo get_feed_url();
?>
</link>
<description><?php
echo get_feed_description();
?>
</description>
<lastBuildDate><?php
echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), FALSE);
?>
</lastBuildDate>
<language><?php
echo $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');
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
//.........这里部分代码省略.........
示例4: apply_filters
echo apply_filters( 'rss_update_frequency', $frequency );
?></sy:updateFrequency>
<?php
/**
* Fires at the end of the RSS2 Feed Header.
*
* @since 2.0.0
*/
do_action( 'rss2_head');
while( have_posts()) : the_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><![CDATA[<?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 = 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 endif; ?>