本文整理汇总了PHP中get_term_feed_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_term_feed_link函数的具体用法?PHP get_term_feed_link怎么用?PHP get_term_feed_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_term_feed_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start_el
/**
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object.
* @param int $depth Depth of category in reference to parents.
* @param array $args
*/
function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
{
extract($args);
$cat_name = esc_attr($category->name);
$cat_name = apply_filters('list_cats', $cat_name, $category);
$link = '<a href="' . esc_url(get_term_link($category)) . '" ';
if ($use_desc_for_title == 0 || empty($category->description)) {
$link .= 'title="' . esc_attr(sprintf(__('View all posts filed under %s'), $cat_name)) . '"';
} else {
$link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
}
$link .= '>';
$link .= $cat_name . '</a>';
if (!empty($feed_image) || !empty($feed)) {
$link .= ' ';
if (empty($feed_image)) {
$link .= '( ';
}
$link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
if (empty($feed)) {
$alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
} else {
$title = ' title="' . $feed . '"';
$alt = ' alt="' . $feed . '"';
$name = $feed;
$link .= $title;
}
$link .= '>';
if (empty($feed_image)) {
$link .= $name;
} else {
$link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
}
$link .= '</a>';
if (empty($feed_image)) {
$link .= ' )';
}
}
if (!empty($show_count)) {
$link .= ' (' . intval($category->count) . ' )';
}
if ('list' == $args['style']) {
$output .= "\t<li";
$class = 'cat-item cat-item-' . $category->term_id;
if (!empty($current_category)) {
$_current_category = get_term($current_category, $category->taxonomy);
if ($category->term_id == $current_category) {
$class .= ' current-cat';
} elseif ($category->term_id == $_current_category->parent) {
$class .= ' current-cat-parent';
}
}
$output .= ' class="' . $class . '"';
$output .= ' data-cat="' . $category->name . '"';
$output .= ">{$link}\n";
} else {
$output .= "\t{$link}<br />\n";
}
}
示例2: Bing_archive_header
/**
*存档页信息
*http://www.bgbk.org
*/
function Bing_archive_header()
{
if (!is_archive()) {
return;
}
if (is_author()) {
$dashicons = 'admin-users';
$name = $GLOBALS['authordata']->display_name;
$description = get_the_author_meta('description');
$feed_link = get_author_feed_link($GLOBALS['authordata']->ID);
} elseif (is_date()) {
$dashicons = 'calendar';
if (is_day()) {
$format = __('Y年m月d日', 'Bing');
} elseif (is_month()) {
$format = __('Y年m月', 'Bing');
} else {
$format = __('Y年', 'Bing');
}
$name = get_the_date($format);
$description = sprintf(__('%s发布的文章', 'Bing'), $name);
} else {
$dashicons = is_tag() ? 'tag' : 'category';
$name = single_term_title('', false);
$description = term_description();
$feed_link = get_term_feed_link(get_queried_object_id(), get_queried_object()->taxonomy);
}
$description = strip_tags($description);
?>
<div class="span12 archive-header">
<article class="panel">
<header class="panel-header">
<h3>
<span class="dashicons dashicons-<?php
echo $dashicons;
?>
"></span><?php
echo $name;
?>
</h3>
<?php
if (Bing_mpanel('breadcrumbs')) {
Bing_breadcrumbs('<span class="separator dashicons dashicons-arrow-right-alt2"></span>', '<span class="right breadcrumb"%s>', '</span>', '<span class="dashicons dashicons-admin-home"></span>' . __('首页', 'Bing'));
}
?>
</header>
<?php
echo empty($description) ? __('无描述', 'Bing') : $description;
if (!empty($feed_link)) {
printf('<a href="%s" title="%s" class="feed-link"><span class="dashicons dashicons-rss"></span></a>', esc_url($feed_link), esc_attr(__('此存档的 Feed 源,可以使用 RSS 阅读器订阅这些内容', 'Bing')));
}
?>
</article>
</div>
<?php
}
示例3: start_el
function start_el($output, $term, $depth, $args)
{
extract($args);
$term_name = esc_attr($term->name);
$term_name = apply_filters('list_cats', $term_name, $term);
$link = '<a href="' . get_term_link($term, $term->taxonomy) . '" ';
if ($use_desc_for_title == 0 || empty($term->description)) {
$link .= 'title="' . sprintf(__('View all posts tagged with %s'), $term_name) . '"';
} else {
$link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $term->description, $term))) . '"';
}
$link .= '>';
$link .= $term_name . '</a>';
if (!empty($feed_image) || !empty($feed)) {
$link .= ' ';
if (empty($feed_image)) {
$link .= '(';
}
$link .= '<a href="' . get_term_feed_link($term->term_id, $term->taxonomy, $feed_type) . '"';
if (empty($feed)) {
$alt = ' alt="' . sprintf(__('Feed for all posts tagged with %s'), $term_name) . '"';
} else {
$title = ' title="' . $feed . '"';
$alt = ' alt="' . $feed . '"';
$name = $feed;
$link .= $title;
}
$link .= '>';
if (empty($feed_image)) {
$link .= $name;
} else {
$link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
}
$link .= '</a>';
if (empty($feed_image)) {
$link .= ')';
}
}
if (isset($show_count) && $show_count) {
$link .= ' (' . intval($term->count) . ')';
}
if (isset($show_date) && $show_date) {
$link .= ' ' . gmdate('Y-m-d', $term->last_update_timestamp);
}
if ('list' == $args['style']) {
$output .= "\t<li";
$class = 'tag-item tag-item-' . $term->term_id;
if (is_tag($term->slug)) {
$class .= ' current-tag';
}
$output .= ' class="' . $class . '"';
$output .= ">{$link}\n";
} else {
$output .= "\t{$link}<br />\n";
}
}
示例4: ap_tag_details
function ap_tag_details()
{
$var = get_query_var('question_tag');
$tag = get_term_by('slug', $var, 'question_tag');
echo '<div class="clearfix">';
echo '<h3><a href="' . get_tag_link($tag) . '">' . $tag->name . '</a></h3>';
echo '<div class="ap-taxo-meta">';
echo '<span class="count">' . $tag->count . ' ' . __('Questions', 'tags-for-anspress') . '</span>';
echo '<a class="aicon-rss feed-link" href="' . get_term_feed_link($tag->term_id, 'question_tag') . '" title="Subscribe to ' . $tag->name . '" rel="nofollow"></a>';
echo '</div>';
echo '</div>';
echo '<p class="desc clearfix">' . $tag->description . '</p>';
}
示例5: ap_category_details
function ap_category_details()
{
$var = get_query_var('question_category');
$category = get_term_by('slug', $var, 'question_category');
echo '<div class="clearfix">';
echo '<h3><a href="' . get_category_link($category) . '">' . $category->name . '</a></h3>';
echo '<div class="ap-taxo-meta">';
echo '<span class="count">' . $category->count . ' ' . __('Questions', 'categories-for-anspress') . '</span>';
echo '<a class="aicon-rss feed-link" href="' . get_term_feed_link($category->term_id, 'question_category') . '" title="Subscribe to ' . $category->name . '" rel="nofollow"></a>';
echo '</div>';
echo '</div>';
echo '<p class="desc clearfix">' . $category->description . '</p>';
$child = get_terms(array('taxonomy' => 'question_category'), array('parent' => $category->term_id, 'hierarchical' => false, 'hide_empty' => false));
if ($child) {
echo '<ul class="ap-child-list clearfix">';
foreach ($child as $key => $c) {
echo '<li><a class="taxo-title" href="' . get_category_link($c) . '">' . $c->name . '<span>' . $c->count . '</span></a>';
echo '</li>';
}
echo '</ul>';
}
}
示例6: powerpressadmin_edit_itunes_feed
//.........这里部分代码省略.........
echo __('WARNING: Changes made here are permanent. If the New Feed URL entered is incorrect, you will lose subscribers and will no longer be able to update your listing in the iTunes Store.', 'powerpress');
?>
</strong></p>
<p><strong><?php
echo __('DO NOT MODIFY THIS SETTING UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING.', 'powerpress');
?>
</strong></p>
<p>
<?php
echo htmlspecialchars(sprintf(__('Apple recommends you maintain the %s tag in your feed for at least two weeks to ensure that most subscribers will receive the new New Feed URL.', 'powerpress'), '<itunes:new-feed-url>'));
?>
</p>
<p>
<?php
$FeedName = __('Main RSS2 feed', 'powerpress');
$FeedURL = get_feed_link('rss2');
if ($cat_ID) {
$category = get_category_to_edit($cat_ID);
$FeedName = sprintf(__('%s category feed', 'powerpress'), htmlspecialchars($category->name));
$FeedURL = get_category_feed_link($cat_ID);
} else {
if ($feed_slug) {
if (!empty($General['custom_feeds'][$feed_slug])) {
$FeedName = $General['custom_feeds'][$feed_slug];
} else {
$FeedName = __('Podcast', 'powerpress');
}
$FeedName = trim($FeedName) . ' ' . __('feed', 'powerpress');
$FeedURL = get_feed_link($feed_slug);
} else {
if ($FeedAttribs['type'] == 'ttid') {
$term_object = get_term_to_edit($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type']);
$FeedName = sprintf(__('%s taxonomy term feed', 'powerpress'), htmlspecialchars($term_object->name));
$FeedURL = get_term_feed_link($FeedAttribs['term_id'], $FeedAttribs['taxonomy_type'], 'rss2');
}
}
}
echo sprintf(__('The New Feed URL value below will be applied to the %s (%s).', 'powerpress'), $FeedName, $FeedURL);
?>
</p>
<p style="margin-bottom: 0;">
<label style="width: 25%; float:left; display:block; font-weight: bold;"><?php
echo __('New Feed URL', 'powerpress');
?>
</label>
<input type="text" name="Feed[itunes_new_feed_url]" style="width: 55%;" value="<?php
echo esc_attr($FeedSettings['itunes_new_feed_url']);
?>
" maxlength="250" />
</p>
<p style="margin-left: 25%;margin-top: 0;font-size: 90%;">(<?php
echo __('Leave blank for no New Feed URL', 'powerpress');
?>
)</p>
<p><a href="http://www.apple.com/itunes/whatson/podcasts/specs.html#changing" target="_blank"><?php
echo __('More information regarding the iTunes New Feed URL is available here.', 'powerpress');
?>
</a></p>
<p>
<?php
if (!$cat_ID && !$feed_slug) {
if (empty($General['channels'])) {
echo sprintf(__('Please activate the \'Custom Podcast Channels\' Advanced Option to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast'));
} else {
echo sprintf(__('Please navigate to the \'Custom Podcast Channels\' section to set the new-feed-url for your podcast only feed (%s)', 'powerpress'), get_feed_link('podcast'));
示例7: 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('»', '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'), 'taxtitle' => __('%1$s %2$s %3$s %4$s Feed'), 'authortitle' => __('%1$s %2$s Posts by %3$s Feed'), 'searchtitle' => __('%1$s %2$s Search Results for “%3$s” 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_tax()) {
$term = get_queried_object();
$tax = get_taxonomy($term->taxonomy);
$title = sprintf($args['taxtitle'], get_bloginfo('name'), $args['separator'], $term->name, $tax->labels->singular_name);
$href = get_term_feed_link($term->term_id, $term->taxonomy);
} 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";
}
}
示例8: clean_permalink
/**
* Removes unneeded query variables from the URL.
* @return boolean
*/
public function clean_permalink()
{
if (is_robots() || get_query_var('sitemap')) {
return false;
}
global $wp_query;
// Recreate current URL
$cururl = 'http';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$cururl .= 's';
}
$cururl .= '://';
if ($_SERVER['SERVER_PORT'] != '80' && $_SERVER['SERVER_PORT'] != '443') {
$cururl .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
} else {
$cururl .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
$properurl = '';
if (is_singular()) {
global $post;
if (empty($post)) {
$post = $wp_query->get_queried_object();
}
$properurl = get_permalink($post->ID);
$page = get_query_var('page');
if ($page && $page != 1) {
$post = get_post($post->ID);
$page_count = substr_count($post->post_content, '<!--nextpage-->');
if ($page > $page_count + 1) {
$properurl = user_trailingslashit(trailingslashit($properurl) . ($page_count + 1));
} else {
$properurl = user_trailingslashit(trailingslashit($properurl) . $page);
}
}
// Fix reply to comment links, whoever decided this should be a GET variable?
$result = preg_match('`(\\?replytocom=[^&]+)`', $_SERVER['REQUEST_URI'], $matches);
if ($result) {
$properurl .= str_replace('?replytocom=', '#comment-', $matches[0]);
}
// Prevent cleaning out posts & page previews for people capable of viewing them
if (isset($_GET['preview']) && isset($_GET['preview_nonce']) && current_user_can('edit_post')) {
$properurl = '';
}
} elseif (is_front_page()) {
if ($this->is_home_posts_page()) {
$properurl = get_bloginfo('url') . '/';
} elseif ($this->is_home_static_page()) {
global $post;
$properurl = get_permalink($post->ID);
}
} elseif (is_category() || is_tag() || is_tax()) {
$term = $wp_query->get_queried_object();
if (is_feed()) {
$properurl = get_term_feed_link($term->term_id, $term->taxonomy);
} else {
$properurl = get_term_link($term, $term->taxonomy);
}
} elseif (is_search()) {
$s = preg_replace('`(%20|\\+)`', ' ', get_search_query());
$properurl = get_bloginfo('url') . '/?s=' . rawurlencode($s);
} elseif (is_404()) {
if (function_exists('is_multisite') && is_multisite() && !is_subdomain_install() && is_main_site()) {
if ($cururl == get_bloginfo('url') . '/blog/' || $cururl == get_bloginfo('url') . '/blog') {
if ($this->is_home_static_page()) {
$properurl = get_permalink(get_option('page_for_posts'));
} else {
$properurl = get_bloginfo('url') . '/';
}
}
}
}
if (!empty($properurl) && $wp_query->query_vars['paged'] != 0 && $wp_query->post_count != 0) {
if (is_search()) {
$properurl = get_bloginfo('url') . '/page/' . $wp_query->query_vars['paged'] . '/?s=' . rawurlencode(get_search_query());
} else {
$properurl = user_trailingslashit(trailingslashit($properurl) . 'page/' . $wp_query->query_vars['paged']);
}
}
// Prevent cleaning out the WP Subscription managers interface for everyone
if (isset($_GET['wp-subscription-manager'])) {
$properurl = '';
}
/**
* Filter: 'wpseo_whitelist_permalink_vars' - Allow plugins to register their own variables not to clean
*
* @api array $unsigned Array of permalink variables _not_ to clean. Empty by default.
*/
$whitelisted_extravars = apply_filters('wpseo_whitelist_permalink_vars', array());
if ($this->options['cleanpermalink-googlesitesearch'] === true) {
// Prevent cleaning out Google Site searches
$whitelisted_extravars = array_merge($whitelisted_extravars, array('q', 'cx', 'debug', 'cof', 'ie', 'sa'));
}
if ($this->options['cleanpermalink-googlecampaign'] === true) {
// Prevent cleaning out Google Analytics campaign variables
$whitelisted_extravars = array_merge($whitelisted_extravars, array('utm_campaign', 'utm_medium', 'utm_source', 'utm_content', 'utm_term', 'utm_id', 'gclid'));
}
//.........这里部分代码省略.........
示例9: start_el
/**
* Start the element output.
*
* @see Walker::start_el()
*
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object.
* @param int $depth Depth of category in reference to parents. Default 0.
* @param array $args An array of arguments. @see wp_list_categories()
* @param int $id ID of the current category.
*/
public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
{
/** This filter is documented in wp-includes/category-template.php */
$cat_name = apply_filters('list_cats', esc_attr($category->name), $category);
// Don't generate an element if the category name is empty.
if (!$cat_name) {
return;
}
$link = '<a href="' . esc_url(get_term_link($category)) . '" ';
if ($args['use_desc_for_title'] && !empty($category->description)) {
/**
* Filter the category description for display.
*
* @since 1.2.0
*
* @param string $description Category description.
* @param object $category Category object.
*/
$link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
}
$link .= '>';
$link .= $cat_name . '</a>';
if (!empty($args['feed_image']) || !empty($args['feed'])) {
$link .= ' ';
if (empty($args['feed_image'])) {
$link .= '(';
}
$link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $args['feed_type'])) . '"';
if (empty($args['feed'])) {
$alt = ' alt="' . sprintf(__('Feed for all posts filed under %s'), $cat_name) . '"';
} else {
$alt = ' alt="' . $args['feed'] . '"';
$name = $args['feed'];
$link .= empty($args['title']) ? '' : $args['title'];
}
$link .= '>';
if (empty($args['feed_image'])) {
$link .= $name;
} else {
$link .= "<img src='" . $args['feed_image'] . "'{$alt}" . ' />';
}
$link .= '</a>';
if (empty($args['feed_image'])) {
$link .= ')';
}
}
if (!empty($args['show_count'])) {
$link .= ' (' . number_format_i18n($category->count) . ')';
}
if ('list' == $args['style']) {
$output .= "\t<li";
$css_classes = array('cat-item', 'cat-item-' . $category->term_id);
if (!empty($args['current_category'])) {
// 'current_category' can be an array, so we use `get_terms()`.
$_current_terms = get_terms($category->taxonomy, array('include' => $args['current_category'], 'hide_empty' => false));
foreach ($_current_terms as $_current_term) {
if ($category->term_id == $_current_term->term_id) {
$css_classes[] = 'current-cat';
} elseif ($category->term_id == $_current_term->parent) {
$css_classes[] = 'current-cat-parent';
}
}
}
/**
* Filter the list of CSS classes to include with each category in the list.
*
* @since 4.2.0
*
* @see wp_list_categories()
*
* @param array $css_classes An array of CSS classes to be applied to each list item.
* @param object $category Category data object.
* @param int $depth Depth of page, used for padding.
* @param array $args An array of wp_list_categories() arguments.
*/
$css_classes = implode(' ', apply_filters('category_css_class', $css_classes, $category, $depth, $args));
$output .= ' class="' . $css_classes . '"';
$output .= ">{$link}\n";
} elseif (isset($args['separator'])) {
$output .= "\t{$link}" . $args['separator'] . "\n";
} else {
$output .= "\t{$link}<br />\n";
}
}
示例10: start_el
/**
* Start the element output.
*
* @see Walker::start_el()
*
* @since 1.1.0
*
* @uses iconize_get_term_icon_by()
* @uses iconize_get_icon()
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object.
* @param int $depth Depth of category in reference to parents. Default 0.
* @param array $args An array of arguments. @see wp_list_categories()
* @param int $id ID of the current category.
*/
function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
{
extract($args);
// Retrive an array of settings for term icon configured in term edit screen if there is icon.
$icon = iconize_get_term_icon_by('id', $category->term_id, $category->taxonomy);
$term_icon_args = array();
if (!empty($icon)) {
$term_icon_args = iconize_get_term_icon_by('id', $category->term_id, $category->taxonomy, 'array');
}
// Validate custom settings passed with 'iconize' arg to wp_list_categories().
$hover_effect = isset($iconized['hover_effect']) ? (string) $iconized['hover_effect'] : 'default';
$color = isset($iconized['color']) ? (string) $iconized['color'] : 'default';
$hover_effect_trigger = isset($iconized['hover_effect_trigger']) ? (string) $iconized['hover_effect_trigger'] : 'link';
$hover_color_change = isset($iconized['hover_color_change']) ? (bool) $iconized['hover_color_change'] : false;
$fallback_icon_args = isset($iconized['fallback_icon']) ? (array) $iconized['fallback_icon'] : array();
$override_icons = isset($iconized['override_icons']) ? (bool) $iconized['override_icons'] : false;
$style = isset($iconized['style']) ? (string) $iconized['style'] : 'default';
$after_icon = isset($iconized['after_icon']) ? (string) $iconized['after_icon'] : ' ';
// Determine which icon to display.
if (true === $override_icons) {
$icon_args = $fallback_icon_args;
} else {
$icon_args = $term_icon_args;
if (empty($icon_args) && !empty($fallback_icon_args)) {
$icon_args = $fallback_icon_args;
}
}
// Modify icon args if needed.
if (!empty($icon_args)) {
if ('iconize' === $style) {
$icon_args['icon_custom_classes'] .= !empty($icon_args['icon_custom_classes']) ? ',iconized-li' : 'iconized-li';
}
if (true === $hover_color_change && false === strpos($icon_args['icon_custom_classes'], 'hover-color-change')) {
$icon_args['icon_custom_classes'] .= !empty($icon_args['icon_custom_classes']) ? ',hover-color-change' : 'hover-color-change';
}
// Override effect and color if needed
if ('default' !== $hover_effect) {
$icon_args['icon_transform'] = $hover_effect;
}
if ('default' !== $color) {
$icon_args['icon_color'] = $color;
}
}
// Generate icon html.
$icon_html = iconize_get_icon($icon_args, $category->taxonomy, $after_icon);
// Generate iconized link.
$cat_name = esc_attr($category->name);
$cat_name = apply_filters('list_cats', $cat_name, $category);
$link = '<a href="' . esc_url(get_term_link($category)) . '" ';
if (0 == $use_desc_for_title || empty($category->description)) {
$link .= 'title="' . esc_attr(sprintf(__('View all posts filed under %s', 'iconize'), $cat_name)) . '"';
} else {
$link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
}
// Add hover effect class to link if needed.
if ('link' === $hover_effect_trigger && !empty($icon_html) && !empty($icon_args['icon_transform']) && !empty($hover_effect)) {
$link .= ' class="iconized-hover-trigger"';
}
$link .= '>';
$link .= $icon_html;
$link .= $cat_name . '</a>';
// The rest
if (!empty($feed_image) || !empty($feed)) {
$link .= ' ';
if (empty($feed_image)) {
$link .= '(';
}
$link .= '<a href="' . esc_url(get_term_feed_link($category->term_id, $category->taxonomy, $feed_type)) . '"';
if (empty($feed)) {
$alt = ' alt="' . sprintf(__('Feed for all posts filed under %s', 'iconize'), $cat_name) . '"';
} else {
$title = ' title="' . $feed . '"';
$alt = ' alt="' . $feed . '"';
$name = $feed;
$link .= $title;
}
$link .= '>';
if (empty($feed_image)) {
$link .= $name;
} else {
$link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
}
$link .= '</a>';
if (empty($feed_image)) {
//.........这里部分代码省略.........
示例11: get_header
/**
* The template for displaying content type archives
*/
get_header();
?>
<div id="content" class="grid_8" role="main">
<?php
if (have_posts()) {
?>
<div class="category-background">
<p class="subscribe"><a href="<?php
echo esc_url(get_term_feed_link(get_queried_object()));
?>
">Follow this topic</a></p>
<h1 class="page-title"><?php
single_term_title();
?>
</h1>
<?php
$term_description = term_description();
if ($term_description) {
echo '<div class="taxonomy-description">' . $term_description . '</div>';
}
?>
</div> <!-- /.category-background -->
示例12: start_el
function start_el(&$output, $category, $depth, $args)
{
extract($args);
$cat_name = esc_attr($category->name);
$cat_name = apply_filters('list_cats', $cat_name, $category);
$link = '<a href="' . esc_attr(get_term_link($category)) . '" ';
if ($use_desc_for_title == 0 || empty($category->description)) {
$link .= 'title="' . esc_attr(sprintf(_x('View all posts filed under %s', 'widget categories', LANGUAGE_ZONE), $cat_name)) . '"';
} else {
$link .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
}
$link .= '>';
$link .= $cat_name;
if (!empty($show_count)) {
$link .= '<span>(' . intval($category->count) . ')</span>';
}
$link .= '</a>';
if (!empty($feed_image) || !empty($feed)) {
$link .= ' ';
if (empty($feed_image)) {
$link .= '(';
}
$link .= '<a href="' . get_term_feed_link($category->term_id, $category->taxonomy, $feed_type) . '"';
if (empty($feed)) {
$alt = ' alt="' . sprintf(_x('Feed for all posts filed under %s', 'widget categories', LANGUAGE_ZONE), $cat_name) . '"';
} else {
$title = ' title="' . $feed . '"';
$alt = ' alt="' . $feed . '"';
$name = $feed;
$link .= $title;
}
$link .= '>';
if (empty($feed_image)) {
$link .= $name;
} else {
$link .= "<img src='{$feed_image}'{$alt}{$title}" . ' />';
}
$link .= '</a>';
if (empty($feed_image)) {
$link .= ')';
}
}
if (!empty($show_date)) {
$link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
}
if ('list' == $args['style']) {
$output .= "\t<li";
$class = 'cat-item cat-item-' . $category->term_id;
if ($this->is_first) {
$class = 'first ' . $class;
$this->is_first = false;
}
if (!empty($current_category)) {
$_current_category = get_term($current_category, $category->taxonomy);
if ($category->term_id == $current_category) {
$class .= ' current-cat';
} elseif ($category->term_id == $_current_category->parent) {
$class .= ' current-cat-parent';
}
}
$output .= ' class="' . $class . '"';
$output .= ">{$link}\n";
} else {
$output .= "\t{$link}<br />\n";
}
}
示例13: setup_term_urls
/**
* Get term archive and feed links for each term
*
* @param $term
* @param $taxonomy
*/
public function setup_term_urls($term, $taxonomy)
{
$term_link = get_term_link($term, $taxonomy);
if (!is_wp_error($term_link)) {
$this->links[] = $term_link;
}
foreach ($this->feeds as $feed) {
$term_link_feed = get_term_feed_link($term, $taxonomy, $feed);
if ($term_link_feed) {
$this->links[] = $term_link_feed;
}
}
}
示例14: largo_term_to_label
function largo_term_to_label($term)
{
return sprintf('<div class="series-label"><h5><a href="%1$s">%2$s</a><a class="rss-link" href="%3$s"></a></h5><p>%4$s</p></div>', get_term_link($term, $term->taxonomy), esc_attr($term->name), get_term_feed_link($term->term_id, $term->taxonomy), esc_attr(strip_tags($term->description)));
}
示例15: start_el
/**
* @see Walker::start_el()
* @since 1.3
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object.
* @param int $depth Depth of category in reference to parents.
* @param array $args
*/
function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0)
{
$output .= '<li><a href="' . esc_url(get_term_link($category)) . '" title="';
if ($category->description) {
$output .= esc_attr($category->description);
} else {
$output .= sprintf(__('View all posts filed under %s', 'sitetree'), SiteTreeUtilities::escTitleAttr($category->name));
}
$output .= '">' . esc_attr($category->name) . '</a>';
if ($args['feed']) {
$output .= ' (<a href="' . esc_url(get_term_feed_link($category->term_id)) . '" title="' . SiteTreeUtilities::escTitleAttr($args['feed']) . '">' . esc_attr($args['feed']) . '</a>)';
}
if ($args['show_count']) {
$output .= ' <span class="sitetree-posts-number">(' . (int) $category->count . ')</span>';
}
}