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


PHP get_search_comments_feed_link函数代码示例

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


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

示例1: get_bloginfo_rss

		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')); ?></updated>
	<?php the_generator( 'atom' ); ?>

<?php if ( is_singular() ) { ?>
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link(); ?>" />
	<link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" />
	<id><?php echo get_post_comments_feed_link('', 'atom'); ?></id>
<?php } elseif(is_search()) { ?>
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . attribute_escape(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('home'); ?>" />
	<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
	<id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?>

<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
	$comment_post = get_post($comment->comment_post_ID);
	get_post_custom($comment_post->ID);
?>
	<entry>
		<title><?php
			if ( !is_singular() ) {
				$title = get_the_title($comment_post->ID);
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:feed-atom-comments.php

示例2: elseif

<?php 
} elseif (is_search()) {
    ?>
	<link rel="alternate" type="<?php 
    bloginfo_rss('html_type');
    ?>
" href="<?php 
    echo get_option('home') . '?s=' . attribute_escape(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('home');
    ?>
" />
	<link rel="self" type="application/atom+xml" href="<?php 
    bloginfo_rss('comments_atom_url');
    ?>
开发者ID:BGCX262,项目名称:zxhproject-svn-to-git,代码行数:31,代码来源:feed-atom-comments.php

示例3: feeds

 /**
  * Generate RSS or Atom feed link elements appropriate to the context.
  * 
  * @hook filter tarski_feeds
  * Filter the RSS or Atam feed link elements before they're printed to the
  * document.
  */
 function feeds()
 {
     global $comments;
     if (is_single() || is_page() && ($comments || comments_open())) {
         global $post;
         $title = sprintf(__('Commments feed for %s', 'tarski'), get_the_title());
         $link = get_post_comments_feed_link($post->ID);
         $source = 'post_comments';
     } elseif (is_archive()) {
         if (is_category()) {
             $title = sprintf(__('Category feed for %s', 'tarski'), single_cat_title('', '', false));
             $link = get_category_feed_link(get_query_var('cat'));
             $source = 'category';
         } elseif (is_tag()) {
             $title = sprintf(__('Tag feed for %s', 'tarski'), single_tag_title('', '', false));
             $link = get_tag_feed_link(get_query_var('tag_id'));
             $source = 'tag';
         } elseif (is_author()) {
             $title = sprintf(__('Articles feed for %s', 'tarski'), the_archive_author_displayname());
             $link = get_author_feed_link(get_query_var('author'));
             $source = 'author';
         } elseif (is_date()) {
             if (is_day()) {
                 $title = sprintf(__('Daily archive feed for %s', 'tarski'), get_the_time(get_option('date_format')));
                 $link = get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d'));
                 $source = 'day';
             } elseif (is_month()) {
                 $title = sprintf(__('Monthly archive feed for %s', 'tarski'), get_the_time('F Y'));
                 $link = get_month_link(get_the_time('Y'), get_the_time('m'));
                 $source = 'month';
             } elseif (is_year()) {
                 $title = sprintf(__('Yearly archive feed for %s', 'tarski'), get_the_time('Y'));
                 $link = get_year_link(get_the_time('Y'));
                 $source = 'year';
             }
             if (get_settings('permalink_structure')) {
                 $link .= 'feed/';
             } else {
                 $link .= '&amp;feed=' . get_default_feed();
             }
         }
     } elseif (is_search()) {
         $search_query = attribute_escape(get_search_query());
         $feeds['search'] = generate_feed_link(sprintf(__('Search feed for %s', 'tarski'), $search_query), get_search_feed_link('', $type), feed_link_type($type));
         $title = sprintf(__('Search comments feed for %s', 'tarski'), $search_query);
         $link = get_search_comments_feed_link('', $type);
         $source = 'search_comments';
     } else {
         $title = false;
     }
     if ($title && $link) {
         $feeds[$source] = generate_feed_link($title, $link, feed_link_type(get_default_feed()));
     }
     $feeds['site'] = generate_feed_link(sprintf(__('%s feed', 'tarski'), get_bloginfo('name')), get_feed_link(), feed_link_type(get_default_feed()));
     $this->feeds = apply_filters('tarski_feeds', $feeds);
 }
开发者ID:nihad,项目名称:tarski,代码行数:63,代码来源:asset.php


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