• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_tag_feed_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_header

<?php

get_header();
$tag_obj = $wp_query->get_queried_object();
?>

<div class="sleeve_main">
	
	<div id="main">
		<h2><?php 
printf(__('Tagged: %s', 'p2'), single_tag_title('', false));
?>
 <a class="rss" href="<?php 
echo get_tag_feed_link($tag_obj->term_id);
?>
">RSS</a></h2>
	
		<?php 
if (have_posts()) {
    ?>
			
			<ul id="postlist">
			<?php 
    while (have_posts()) {
        the_post();
        ?>
				
				<?php 
        p2_load_entry();
        ?>
			
开发者ID:alx,项目名称:pressmark,代码行数:30,代码来源:tag.php


示例2: get_header

<?php
/**
 * @package WordPress
 * @subpackage P2
 */
?>
<?php get_header(); ?>
<?php $tag_obj = $wp_query->get_queried_object(); ?>

<div class="sleeve_main">

	<div id="main">
		<h2><?php printf( __( 'Tagged: %s', 'p2' ), single_tag_title( '', false) ); ?> <a class="rss" href="<?php echo get_tag_feed_link( $tag_obj->term_id ); ?>">RSS</a></h2>

		<?php if ( have_posts() ) : ?>

			<ul id="postlist">
			<?php while ( have_posts() ) : the_post(); ?>

				<?php p2_load_entry(); // loads entry.php ?>

			<?php endwhile; ?>
			</ul>

		<?php else : ?>

			<div class="no-posts">
			    <h3><?php _e( 'No posts found!', 'p2' ); ?></h3>
			</div>

		<?php endif ?>
开发者ID:r-chopra17,项目名称:p2bp,代码行数:31,代码来源:tag.php


示例3: getTag

 public function getTag()
 {
     $pathway = array();
     $tid = (int) get_query_var('tag');
     $tag = get_category($tid);
     $title = single_cat_title('', false);
     //  rss
     $pathway['first'] = array($title . ' taxonomy feeds', array('href' => get_tag_feed_link($tid), 'type' => 'application/rss+xml', 'title' => __($title . ' | Subscribe to this feed', WPI_META), 'hreflang' => get_hreflang(), 'rel' => self::RSS_REL, 'class' => 'rtxt rss16', 'rev' => 'feed:rss2'));
     // home
     $pathway['home'] = $this->getFrontpage();
     //tag_base
     $tag_base = str_rem('/', get_option('tag_base'));
     if ($tag_base) {
         $tag_base = ucfirst($tag_base);
     } else {
         $tag_base = __('Taxonomy', WPI_META);
     }
     $pathway['archive'] = array($tag_base, array('href' => '#content-top', 'title' => __($tag_base . ' | Skip to content', WPI_META)));
     $tid = get_query_var('tag_id');
     $tag = get_term($tid, 'post_tag');
     $pathway['last'] = array($tag->name, array('href' => '#content-top', 'title' => __('Skip to content | ' . $tag->name, WPI_META), 'class' => self::CAT_LINK_CLASS . ' ' . self::DN_ARROW, 'rev' => 'site:archive'));
     unset($tag);
     return $pathway;
 }
开发者ID:Creativebq,项目名称:wp-istalker,代码行数:24,代码来源:pathway.php


示例4: the_post

<div class="clearfix">

	<?php 
if (have_posts() || largo_have_featured_posts()) {
    // queue up the first post so we know what type of archive page we're dealing with
    the_post();
    /*
     * Display some different stuff in the header
     * depending on what type of archive page we're looking at
     */
    if (is_author()) {
        $rss_link = get_author_feed_link(get_the_author_meta('ID'));
    } elseif (is_tag()) {
        $title = single_tag_title('', false);
        $description = tag_description();
        $rss_link = get_tag_feed_link(get_queried_object_id());
    } elseif (is_tax()) {
        $title = single_term_title('', false);
        $description = term_description();
        // rss links for custom taxonomies are a little tricky
        $queried_object = get_queried_object();
        $term_id = intval($queried_object->term_id);
        $tax = $queried_object->taxonomy;
        $rss_link = get_term_feed_link($term_id, $tax);
    } elseif (is_date()) {
        $description = __('Select a different month:', 'largo');
        if (is_month()) {
            $title = sprintf(__('Monthly Archives: <span>%s</span>', 'largo'), get_the_date('F Y'));
        } elseif (is_year()) {
            $title = sprintf(__('Yearly Archives: <span>%s</span>', 'largo'), get_the_date('Y'));
        } else {
开发者ID:NathanLawrence,项目名称:Largo,代码行数:31,代码来源:archive.php


示例5: wp_getTags

 /**
  * Get list of all tags
  *
  * @since 2.7
  *
  * @param array $args Method parameters.
  * @return array
  */
 function wp_getTags($args)
 {
     $this->escape($args);
     $blog_id = (int) $args[0];
     $username = $args[1];
     $password = $args[2];
     if (!$this->login_pass_ok($username, $password)) {
         return $this->error;
     }
     set_current_user(0, $username);
     if (!current_user_can('edit_posts')) {
         return new IXR_Error(401, __('Sorry, you must be able to edit posts on this blog in order to view tags.'));
     }
     do_action('xmlrpc_call', 'wp.getKeywords');
     $tags = array();
     if ($all_tags = get_tags()) {
         foreach ((array) $all_tags as $tag) {
             $struct['tag_id'] = $tag->term_id;
             $struct['name'] = $tag->name;
             $struct['count'] = $tag->count;
             $struct['slug'] = $tag->slug;
             $struct['html_url'] = wp_specialchars(get_tag_link($tag->term_id));
             $struct['rss_url'] = wp_specialchars(get_tag_feed_link($tag->term_id));
             $tags[] = $struct;
         }
     }
     return $tags;
 }
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:36,代码来源:xmlrpc.php


示例6: feed_links_extra

/**
 * Display the links to the extra feeds such as category feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links_extra($args = array())
{
    $defaults = array('separator' => _x('&raquo;', 'feed link'), 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'), 'posttypetitle' => __('%1$s %2$s %3$s Feed'));
    $args = wp_parse_args($args, $defaults);
    if (is_singular()) {
        $id = 0;
        $post = get_post($id);
        if (comments_open() || pings_open() || $post->comment_count > 0) {
            $title = sprintf($args['singletitle'], get_bloginfo('name'), $args['separator'], the_title_attribute(array('echo' => false)));
            $href = get_post_comments_feed_link($post->ID);
        }
    } elseif (is_post_type_archive()) {
        $post_type = get_query_var('post_type');
        if (is_array($post_type)) {
            $post_type = reset($post_type);
        }
        $post_type_obj = get_post_type_object($post_type);
        $title = sprintf($args['posttypetitle'], get_bloginfo('name'), $args['separator'], $post_type_obj->labels->name);
        $href = get_post_type_archive_feed_link($post_type_obj->name);
    } elseif (is_category()) {
        $term = get_queried_object();
        if ($term) {
            $title = sprintf($args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name);
            $href = get_category_feed_link($term->term_id);
        }
    } elseif (is_tag()) {
        $term = get_queried_object();
        if ($term) {
            $title = sprintf($args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name);
            $href = get_tag_feed_link($term->term_id);
        }
    } elseif (is_author()) {
        $author_id = intval(get_query_var('author'));
        $title = sprintf($args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta('display_name', $author_id));
        $href = get_author_feed_link($author_id);
    } elseif (is_search()) {
        $title = sprintf($args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query(false));
        $href = get_search_feed_link();
    } elseif (is_post_type_archive()) {
        $title = sprintf($args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title('', false));
        $post_type_obj = get_queried_object();
        if ($post_type_obj) {
            $href = get_post_type_archive_feed_link($post_type_obj->name);
        }
    }
    if (isset($title) && isset($href)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr($title) . '" href="' . esc_url($href) . '" />' . "\n";
    }
}
开发者ID:jenoya,项目名称:final,代码行数:56,代码来源:general-template.php


示例7: wp_getTags

 /**
  * Get list of all tags
  *
  * @since 2.7.0
  *
  * @param array $args Method parameters.
  * @return array|IXR_Error
  */
 public function wp_getTags($args)
 {
     $this->escape($args);
     $username = $args[1];
     $password = $args[2];
     if (!($user = $this->login($username, $password))) {
         return $this->error;
     }
     if (!current_user_can('edit_posts')) {
         return new IXR_Error(401, __('Sorry, you must be able to edit posts on this site in order to view tags.'));
     }
     /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
     do_action('xmlrpc_call', 'wp.getKeywords');
     $tags = array();
     if ($all_tags = get_tags()) {
         foreach ((array) $all_tags as $tag) {
             $struct = array();
             $struct['tag_id'] = $tag->term_id;
             $struct['name'] = $tag->name;
             $struct['count'] = $tag->count;
             $struct['slug'] = $tag->slug;
             $struct['html_url'] = esc_html(get_tag_link($tag->term_id));
             $struct['rss_url'] = esc_html(get_tag_feed_link($tag->term_id));
             $tags[] = $struct;
         }
     }
     return $tags;
 }
开发者ID:sb-xs,项目名称:que-pour-elle,代码行数:36,代码来源:class-wp-xmlrpc-server.php


示例8: extendedPostTags

 /**
  * Generate current post tags
  *
  * @param string $args
  * @return string
  */
 function extendedPostTags($args = '', $copyright = true)
 {
     $defaults = array('before' => __('Tags: ', 'simpletags'), 'separator' => ', ', 'after' => '<br />', 'post_id' => 0, 'no_follow' => 0, 'inc_cats' => 0, 'xformat' => __('<a href="%tag_link%" title="%tag_name%" %tag_rel%>%tag_name%</a>', 'simpletags'), 'notagtext' => __('No tag for this post.', 'simpletags'), 'number' => 0);
     // Get values in DB
     $defaults['no_follow'] = $this->options['no_follow'];
     $defaults['before'] = $this->options['tt_before'];
     $defaults['separator'] = $this->options['tt_separator'];
     $defaults['after'] = $this->options['tt_after'];
     $defaults['notagtext'] = $this->options['tt_notagstext'];
     $defaults['number'] = $this->options['tt_number'];
     $defaults['inc_cats'] = $this->options['tt_inc_cats'];
     $defaults['xformat'] = $this->options['tt_xformat'];
     if (empty($args)) {
         $args = $this->options['tt_adv_usage'];
     }
     $args = wp_parse_args($args, $defaults);
     extract($args);
     // Choose post ID
     $post_id = (int) $post_id;
     if ($post_id != 0) {
         $id = (int) $post_id;
     } else {
         global $post;
         $id = (int) $post->ID;
     }
     // Get categories ?
     $inc_cats = (int) $args['inc_cats'];
     $taxonomy = $inc_cats == 0 ? 'post_tag' : array('post_tag', 'category');
     // Get terms
     $terms = apply_filters('get_the_tags', wp_get_object_terms($id, $taxonomy));
     // If no terms, return text nothing.
     if (empty($terms)) {
         return $notagtext;
     }
     // Limit to max quantity if set
     $number = (int) $number;
     if ($number != 0) {
         $terms = $this->randomArray($terms);
         // Randomize terms
         $terms = array_slice($terms, 0, $number);
     }
     // If empty use default xformat !
     if (empty($xformat)) {
         $xformat = $defaults['xformat'];
     }
     // HTML Rel (tag/no-follow)
     $rel = '';
     global $wp_rewrite;
     $rel .= is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ? 'tag' : '';
     // Tag ?
     $no_follow = (int) $no_follow;
     if ($no_follow == 1) {
         // No follow ?
         $rel .= empty($rel) ? 'nofollow' : ' nofollow';
     }
     if (!empty($rel)) {
         $rel = 'rel="' . $rel . '"';
         // Add HTML Tag
     }
     foreach ((array) $terms as $term) {
         $element_loop = $xformat;
         if ($term->taxonomy == 'post_tag') {
             // Tag
             $element_loop = str_replace('%tag_link%', clean_url(get_tag_link($term->term_id)), $element_loop);
             $element_loop = str_replace('%tag_feed%', clean_url(get_tag_feed_link($term->term_id)), $element_loop);
         } else {
             // Category
             $element_loop = str_replace('%tag_link%', clean_url(get_category_link($term->term_id)), $element_loop);
             $element_loop = str_replace('%tag_feed%', clean_url(get_category_rss_link(false, $term->term_id, '')), $element_loop);
         }
         $element_loop = str_replace('%tag_id%', $term->term_id, $element_loop);
         $element_loop = str_replace('%tag_name%', wp_specialchars($term->name), $element_loop);
         $element_loop = str_replace('%tag_rel%', $rel, $element_loop);
         $element_loop = str_replace('%tag_count%', $term->count, $element_loop);
         $element_loop = str_replace('%tag_technorati%', $this->formatLink('technorati', $term->name), $element_loop);
         $element_loop = str_replace('%tag_flickr%', $this->formatLink('flickr', $term->name), $element_loop);
         $element_loop = str_replace('%tag_delicious%', $this->formatLink('delicious', $term->name), $element_loop);
         $output[] = $element_loop;
     }
     unset($terms, $term, $element_loop);
     $output = apply_filters('the_tags', implode($separator, $output));
     if ($copyright === true) {
         return "\n\t" . '<!-- Generated by Simple Tags ' . $this->version . ' - http://wordpress.org/extend/plugins/simple-tags -->' . "\n\t" . $before . $output . $after . "\n";
     } else {
         return "\n\t" . $before . $output . $after . "\n";
     }
 }
开发者ID:saatchidgs,项目名称:ourhouse,代码行数:93,代码来源:simple-tags.client.php


示例9: feed_links_extra

/**
 * Display the links to the extra feeds such as category feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links_extra($args)
{
    $defaults = array('seperator' => _c('&raquo;|Seperator character feed titles in theme head'), 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for &quot;%3$s&quot; Feed'));
    $args = wp_parse_args($args, $defaults);
    if (is_single() || is_page()) {
        $post =& get_post($id = 0);
        if (comments_open() || pings_open() || $post->comment_count > 0) {
            echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . sprintf($args['singletitle'], get_bloginfo('name'), $args['seperator'], wp_specialchars(get_the_title())) . '" href="' . get_post_comments_feed_link($post->ID) . "\" />\n";
        }
    } elseif (is_category()) {
        $cat_id = intval(get_query_var('cat'));
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . sprintf($args['cattitle'], get_bloginfo('name'), $args['seperator'], get_cat_name($cat_id)) . '" href="' . get_category_feed_link($cat_id) . "\" />\n";
    } elseif (is_tag()) {
        $tag_id = intval(get_query_var('tag_id'));
        $tag = get_tag($tag_id);
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . sprintf($args['tagtitle'], get_bloginfo('name'), $args['seperator'], $tag->name) . '" href="' . get_tag_feed_link($tag_id) . "\" />\n";
    } elseif (is_author()) {
        $author_id = intval(get_query_var('author'));
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . sprintf($args['authortitle'], get_bloginfo('name'), $args['seperator'], get_author_name($author_id)) . '" href="' . get_author_feed_link($author_id) . "\" />\n";
    } elseif (is_search()) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . sprintf($args['searchtitle'], get_bloginfo('name'), $args['seperator'], get_search_query()) . '" href="' . get_search_feed_link() . "\" />\n";
    }
}
开发者ID:blowery,项目名称:wordpress,代码行数:30,代码来源:general-template.php


示例10: largo_categories_and_tags

 function largo_categories_and_tags($max = 5, $echo = true, $link = true, $use_icon = false, $separator = ', ', $item_wrapper = 'span', $exclude = array(), $rss = false)
 {
     $cats = get_the_category();
     $tags = get_the_tags();
     $icon = '';
     $output = array();
     // if $use_icon is true, include the markup for the tag icon
     if ($use_icon === true) {
         $icon = '<i class="icon-white icon-tag"></i>';
     } elseif ($use_icon) {
         $icon = '<i class="icon-white icon-' . esc_attr($use_icon) . '"></i>';
     }
     if ($cats) {
         foreach ($cats as $cat) {
             // skip uncategorized and any others in the array of terms to exclude
             if ($cat->name == 'Uncategorized' || in_array($cat->term_id, $exclude)) {
                 continue;
             }
             if ($link) {
                 $output[] = sprintf(__('<%1$s class="post-category-link"><a href="%2$s" title="Read %3$s in the %4$s category">%5$s%4$s</a></%1$s>', 'largo'), $item_wrapper, $rss ? get_category_feed_link($cat->term_id) : get_category_link($cat->term_id), of_get_option('posts_term_plural'), $cat->name, $icon);
             } else {
                 $output[] = $cat->name;
             }
         }
     }
     if ($tags) {
         foreach ($tags as $tag) {
             if (in_array($tag->term_id, $exclude)) {
                 continue;
             }
             if ($link) {
                 $output[] = sprintf(__('<%1$s class="post-tag-link"><a href="%2$s" title="Read %3$s tagged with: %4$s">%5$s%4$s</a></%1$s>', 'largo'), $item_wrapper, $rss ? get_tag_feed_link($tag->term_id) : get_tag_link($tag->term_id), of_get_option('posts_term_plural'), $tag->name, $icon);
             } else {
                 $output[] = $tag->name;
             }
         }
     }
     if ($echo) {
         echo implode($separator, array_slice($output, 0, $max));
     }
     return $output;
 }
开发者ID:NathanLawrence,项目名称:Largo,代码行数:42,代码来源:related-content.php


示例11: do_flush_term

 /**
  * do_flush_term()
  *
  * @param int $term_id
  * @param string $taxonomy
  * @return void
  **/
 static function do_flush_term($term_id, $taxonomy)
 {
     static $done = array();
     if (isset($done[$taxonomy][$term_id])) {
         return;
     }
     $done[$taxonomy][$term_id] = true;
     if ($taxonomy == 'category') {
         $link = @get_category_link($term_id);
     } else {
         $link = @get_tag_link($term_id);
     }
     if (is_wp_error($link) || !$link) {
         return;
     }
     self::flush_url($link);
     foreach (array('rss2', 'atom') as $feed) {
         if ($taxonomy == 'category') {
             $link = get_category_feed_link($term_id, $feed);
         } else {
             $link = get_tag_feed_link($term_id, $feed);
         }
         $link = str_replace('&amp;', '&', $link);
         self::flush_feed_url($link);
     }
 }
开发者ID:semiologic,项目名称:sem-cache,代码行数:33,代码来源:sem-cache.php


示例12: 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


示例13: feed_links_extra

 /**
  * Display the links to the extra feeds such as category feeds.
  *
  * Copy from WP default, but without comment feed; no filter available.
  *
  * @since 04/08/2013
  *
  * @param array $args Optional argument.
  */
 public function feed_links_extra($args = array())
 {
     $defaults = ['separator' => _x('&raquo;', 'feed link'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'), 'posttypetitle' => __('%1$s %2$s %3$s Feed')];
     $args = wp_parse_args($args, $defaults);
     if (is_category()) {
         $term = get_queried_object();
         $title = sprintf($args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name);
         $href = get_category_feed_link($term->term_id);
     } elseif (is_tag()) {
         $term = get_queried_object();
         $title = sprintf($args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name);
         $href = get_tag_feed_link($term->term_id);
     } elseif (is_author()) {
         $author_id = intval(get_query_var('author'));
         $title = sprintf($args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta('display_name', $author_id));
         $href = get_author_feed_link($author_id);
     } elseif (is_search()) {
         $title = sprintf($args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query(FALSE));
         $href = get_search_feed_link();
     } elseif (is_post_type_archive()) {
         $title = sprintf($args['posttypetitle'], get_bloginfo('name'), $args['separator'], post_type_archive_title('', FALSE));
         $href = get_post_type_archive_feed_link(get_queried_object()->name);
     }
     if (isset($title) && isset($href)) {
         echo '<link rel="alternate" type="' . esc_attr(feed_content_type()) . '" title="' . esc_attr($title) . '" href="' . esc_url($href) . '" />' . "\n";
     }
 }
开发者ID:palimadra,项目名称:Remove-Comments-Absolutely,代码行数:36,代码来源:remove-comments-absolute.php


示例14: getFeedUrl

 /**
  * FeedのURLを返す
  *
  * @return string
  */
 public function getFeedUrl()
 {
     switch ($this->type) {
         case "home":
             return get_bloginfo('rss2_url');
         case "post":
             return get_post_comments_feed_link();
         case "category":
             $cat = $this->getCategory($this->termID);
             return get_category_feed_link($cat->cat_ID);
         case "tag":
             $tag = $this->getTag($this->termID);
             return get_tag_feed_link($tag->term_id);
         default:
             throw new Exception("unkown type");
             break;
     }
 }
开发者ID:Aquei,项目名称:purely,代码行数:23,代码来源:Feed.php


示例15: formatInternalTag

	/**
	 * Remplace marker by dynamic values (use for related tags, current tags and tag cloud)
	 *
	 * @param string $element_loop
	 * @param object $term
	 * @param string $rel
	 * @param integer $scale_result
	 * @param integer $scale_max
	 * @param integer $scale_min
	 * @param integer $largest
	 * @param integer $smallest
	 * @param string $unit
	 * @param string $maxcolor
	 * @param string $mincolor
	 * @return string
	 */
	function formatInternalTag( $element_loop = '', $term = null, $rel = '', $scale_result = 0, $scale_max = null, $scale_min = 0, $largest = 0, $smallest = 0, $unit = '', $maxcolor = '', $mincolor = '' ) {
		// Need term object
		if ( $term->taxonomy == 'post_tag' ) { // Tag post
			$element_loop = str_replace('%tag_link%', clean_url(get_tag_link($term->term_id)), $element_loop);
			$element_loop = str_replace('%tag_feed%', clean_url(get_tag_feed_link($term->term_id)), $element_loop);
		} else { // Category
			$element_loop = str_replace('%tag_link%', clean_url(get_category_link($term->term_id)), $element_loop);
			$element_loop = str_replace('%tag_feed%', clean_url(get_category_rss_link(false, $term->term_id, '')), $element_loop);
		}
		$element_loop = str_replace('%tag_name%', wp_specialchars( $term->name ), $element_loop);
		$element_loop = str_replace('%tag_name_attribute%', wp_specialchars(strip_tags($term->name)), $element_loop);
		$element_loop = str_replace('%tag_id%', $term->term_id, $element_loop);
		$element_loop = str_replace('%tag_count%', (int) $term->count, $element_loop);

		// Need rel
		$element_loop = str_replace('%tag_rel%', $rel, $element_loop);

		// Need max/min/scale and other :)
		if ( $scale_result !== null ) {
			$element_loop = str_replace('%tag_size%', 'font-size:'.round(($scale_result - $scale_min)*($largest-$smallest)/($scale_max - $scale_min) + $smallest, 2).$unit.';', $element_loop);
			$element_loop = str_replace('%tag_color%', 'color:'.$this->getColorByScale(round(($scale_result - $scale_min)*(100)/($scale_max - $scale_min), 2),$mincolor,$maxcolor).';', $element_loop);
			$element_loop = str_replace('%tag_scale%', $scale_result, $element_loop);
		}

		// External link
		$element_loop = str_replace('%tag_technorati%', $this->formatExternalTag( 'technorati', $term->name ), $element_loop);
		$element_loop = str_replace('%tag_flickr%', $this->formatExternalTag( 'flickr', $term->name ), $element_loop);
		$element_loop = str_replace('%tag_delicious%', $this->formatExternalTag( 'delicious', $term->name ), $element_loop);

		return $element_loop;
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:47,代码来源:simple-tags.client.php


示例16: tag_description

if (have_posts()) {
    ?>
    	    <header class="archive-header">
    	    	<?php 
    if (tag_description()) {
        ?>
    	        	<div class="archive-meta">
    	        		<?php 
        echo tag_description();
        ?>
    	        	</div>
	    		<?php 
    }
    ?>
	    		<a href="<?php 
    echo get_tag_feed_link($tag_id);
    ?>
" title="<?php 
    _e('Subscribe to this tag', 'panamazonica');
    ?>
" class="icon-alone feed-link"><span aria-hidden="true" data-icon="&#xf09e;"></span><span class="assistive-text"><?php 
    _e('Tag feed', 'panamazonica');
    ?>
</span></a>
    	        <h1 class="archive-title"><?php 
    single_tag_title();
    ?>
</h1>
    	    </header><!-- /archive-header -->
    
            <?php 
开发者ID:aspto,项目名称:wordpress-themes,代码行数:31,代码来源:tag.php


示例17: feed_links_extra

/**
 * Display the links to the extra feeds such as category feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links_extra($args)
{
    $defaults = array('separator' => _x('&raquo;', 'feed link'), 'singletitle' => __('%1$s %2$s %3$s Comments Feed'), 'cattitle' => __('%1$s %2$s %3$s Category Feed'), 'tagtitle' => __('%1$s %2$s %3$s Tag Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for &#8220;%3$s&#8221; Feed'));
    $args = wp_parse_args($args, $defaults);
    if (is_single() || is_page()) {
        $post =& get_post($id = 0);
        if (comments_open() || pings_open() || $post->comment_count > 0) {
            $title = esc_attr(sprintf($args['singletitle'], get_bloginfo('name'), $args['separator'], esc_html(get_the_title())));
            $href = get_post_comments_feed_link($post->ID);
        }
    } elseif (is_category()) {
        $cat_id = intval(get_query_var('cat'));
        $title = esc_attr(sprintf($args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name($cat_id)));
        $href = get_category_feed_link($cat_id);
    } elseif (is_tag()) {
        $tag_id = intval(get_query_var('tag_id'));
        $tag = get_tag($tag_id);
        $title = esc_attr(sprintf($args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name));
        $href = get_tag_feed_link($tag_id);
    } elseif (is_author()) {
        $author_id = intval(get_query_var('author'));
        $title = esc_attr(sprintf($args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta('display_name', $author_id)));
        $href = get_author_feed_link($author_id);
    } elseif (is_search()) {
        $title = esc_attr(sprintf($args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query()));
        $href = get_search_feed_link();
    }
    if (isset($title) && isset($href)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . $title . '" href="' . $href . '" />' . "\n";
    }
}
开发者ID:hoonio,项目名称:wordpress,代码行数:38,代码来源:general-template+backup.php


示例18: edit_category_form

 function edit_category_form($input)
 {
     global $wp_version, $action;
     //~ echo "\n<pre>\n";
     //~ var_dump('in function edit_category_form');
     //~ var_dump($input);
     //~ var_dump($input->taxonomy);
     //~ var_dump($action);
     //~ var_dump($_GET['action']);
     //~ var_dump($wp_version);
     //~ echo "\n</pre>\n";
     if ('edit' == $_GET['action'] and TRUE == version_compare($wp_version, '2.7', '>=') or 'editedcat' == $action) {
         // show the following form only when an existing category is going to be edited.
         if (FALSE === isset($input->taxonomy) or TRUE === empty($input->taxonomy) or 'post_tag' !== $input->taxonomy and 'category' !== $input->taxonomy) {
             $taxonomy = 'misc';
             $taxonomy_str = __('Taxonomy', 'podpress');
         } else {
             $taxonomy = $input->taxonomy;
             switch ($taxonomy) {
                 case 'post_tag':
                     $taxonomy_str = __('Tag', 'podpress');
                     break;
                 case 'category':
                     $taxonomy_str = __('Category', 'podpress');
                     break;
             }
         }
         //~ printphpnotices_var_dump('print edit_'.$taxonomy.'_form');
         //~ printphpnotices_var_dump($input);
         $data = podPress_get_option('podPress_' . $taxonomy . '_' . $input->term_id);
         $blog_charset = get_bloginfo('charset');
         if (empty($data['podcastFeedURL'])) {
             if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                 // since WP 3.0 the cat_ID isreplaced by tag_ID
                 $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
             } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                 switch ($taxonomy) {
                     default:
                     case 'post_tag':
                         $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                         break;
                     case 'category':
                         $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                         break;
                 }
             } else {
                 $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
             }
         } else {
             $url_parts = parse_url($data['podcastFeedURL']);
             if (isset($url_parts['query'])) {
                 $output = '';
                 parse_str($url_parts['query'], $output);
                 if (TRUE === isset($output['cat']) and FALSE !== empty($output['cat'])) {
                     if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                         // since WP 3.0 the cat_ID isreplaced by tag_ID
                         $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
                     } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                         switch ($taxonomy) {
                             default:
                             case 'post_tag':
                                 $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                                 break;
                             case 'category':
                                 $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                                 break;
                         }
                     } else {
                         $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
                     }
                 }
             }
         }
         // some ids of category input fields have changed with WP 3.0
         $wp_version_parts = explode('.', $wp_version);
         if (is_array($wp_version_parts)) {
             $main_wp_version = $wp_version_parts[0];
         } else {
             $main_wp_version = 0;
         }
         echo '<div class="wrap">' . "\n";
         if (TRUE == version_compare($wp_version, '2.7', '>=')) {
             echo '<div id="podpress-icon" class="icon32"><br /></div>';
         }
         echo '	<h2>' . sprintf(__('podPress %1$s Casting', 'podpress'), $taxonomy_str) . '</h2>' . "\n";
         echo '	<label for="categoryCasting"><strong>' . sprintf(__('Enable %1$s Casting', 'podpress'), $taxonomy_str) . '</strong></label>  <a href="javascript:void(null);" onclick="javascript: podPressShowHideDiv(\'categoryCastingHelp\');">(?)</a>:';
         echo '	<input type="checkbox" name="categoryCasting" id="categoryCasting" ';
         if ($data['categoryCasting'] == 'true') {
             echo 'checked="checked"';
         }
         echo ' onclick="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '	<div id="categoryCastingHelp" style="display: none;">' . "\n";
         echo '		' . __('This feature is for cases in which you want to host more than one podcast in one blog or if you want to have different podcast feeds with different media files of certain file types per feed (e.g a feed which contains only .mp3 files).<br />Basically this feature gives you the opportunity to modify some of the feed elements and set them to other then as the general value from the Feed/iTunes Settings of podPress.<br/>For instance: If you organize your audio episodes in one category and the video episodes in a different category then you can modify the feed content describing values like the title or the description in the form below. This your category feeds will be more distinguishable from another.', 'podpress') . '<br />' . "\n";
         echo '	</div>' . "\n";
         echo '  <div class="wrap" id="iTunesSpecificSettings" style="display: none; border: 0;">' . "\n";
         podPress_DirectoriesPreview('edit_category_form');
         echo '		<fieldset class="options">' . "\n";
         echo '		<legend>' . sprintf(__('%1$s Feed Options', 'podpress'), $taxonomy_str) . '</legend>' . "\n";
         echo '		<h3>' . __('iTunes Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
//.........这里部分代码省略.........
开发者ID:cracknel,项目名称:ubuntudanmark.dk,代码行数:101,代码来源:podpress_admin_class.php


示例19: prologue_recent_projects

function prologue_recent_projects($num_to_show = 35, $before = '', $after = '')
{
    $cache  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_tag_link函数代码示例发布时间:2022-05-15
下一篇:
PHP get_tag函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap