Exemple #1
0
<?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();
        ?>
			
Exemple #2
0
<?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 ?>
Exemple #3
0
 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;
 }
Exemple #4
0
<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 {
 /**
  * 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;
 }
Exemple #6
0
/**
 * 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";
    }
}
 /**
  * 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;
 }
 /**
  * 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";
     }
 }
/**
 * 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";
    }
}
 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;
 }
Exemple #11
0
 /**
  * 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);
     }
 }
Exemple #12
0
 /**
  * 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);
 }
 /**
  * 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";
     }
 }
Exemple #14
0
 /**
  * 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;
     }
 }
	/**
	 * 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;
	}
Exemple #16
0
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 
/**
 * 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";
    }
}
 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";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSubtitleChoice">' . __('iTunes:Subtitle', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSubtitleChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSubtitleChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesSubtitleWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSubtitle" class="podpress_wide_text_field" rows="2" cols="40">' . stripslashes($data['iTunesSubtitle']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSubtitleHelp">' . "\n";
         echo '						' . __('A few words which describe the feed title a little bit more (max. 255 characters).', 'podpress') . ' ' . __('By default this is taken from the default iTunes:subtitle.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSummaryChoice">' . __('iTunes:Summary', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSummaryChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSummaryChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_iTunesSummary" value="' . attribute_escape(stripslashes($this->settings['iTunes']['summary'])) . '" />' . "\n";
         echo '					<div id="iTunesSummaryWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSummary" id="iTunesSummary" class="podpress_wide_text_field" rows="6" cols="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . stripslashes($data['iTunesSummary']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSummaryHelp">' . "\n";
         echo '						' . __('The description of the podcast.', 'podpress') . ' ' . __('By default this is taken from the default iTunes:Summary or the default description.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesImageChoice">' . __('iTunes:Image', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					' . __('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 1400 x 1400 pixels</a> as Apple writes in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress') . "\n";
         echo '					<br/>';
         echo '					<select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesImageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesImageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesImageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="iTunesImage" type="text" name="iTunesImage" value="' . $data['iTunesImage'] . '" class="podpress_wide_text_field" size="40" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_iTunesImage" type="hidden" value="' . $this->settings['iTunes']['image'] . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="itunes_image_display" style="width:300px; height:300px;" alt="' . __('Podcast Image - Big (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" /><br />' . "\n";
         echo '					<em>' . __('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress') . '</em>';
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorChoice">' . __('iTunes:Author/Owner', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthor" class="podpress_wide_text_field" size="40" id="iTunesAuthor" value="' . attribute_escape(stripslashes($data['iTunesAuthor'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthor" value="' . attribute_escape(stripslashes($this->settings['iTunes']['author'])) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorHelp">' . "\n";
         echo '						' . __('Used if this Author is different than the feeds author.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			<tr>' . "\n";
         echo '			</tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorEmailChoice">' . __('Owner E-mail address', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorEmailChoice" name="iTunesAuthorEmailChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorEmailChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes(get_option('admin_email'))), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorEmailChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorEmailWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthorEmail" class="podpress_wide_text_field" size="40" id="iTunesAuthorEmail" value="' . attribute_escape(stripslashes($data['iTunesAuthorEmail'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthorEmail" value="' . attribute_escape(stripslashes(get_option('admin_email'))) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorEmailHelp">' . "\n";
         echo '						' . __('Used if the owner of this category is different than the feeds owner.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesKeywordsChoice">' . __('iTunes:Keywords', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesKeywordsChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesKeywordsChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesKeywordsWrapper">' . "\n";
         echo '						' . __('a list of max. 12 comma separated words', 'podpress') . '<br/><textarea name="iTunesKeywords" rows="4" cols="40">' . stripslashes($data['iTunesKeywords']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesKeywordsHelp">' . "\n";
         echo '						' . __('Not visible in iTunes, but used for searches.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesCategory_0">' . __('iTunes:Categories', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Primary', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][0])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][0];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][0])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][0]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<input type="hidden" id="global_iTunesCategory" value="' . attribute_escape($this->settings['iTunes']['category'][0]) . '" />' . "\n";
         echo '					<select name="iTunesCategory[1]">' . "\n";
         echo '						<optgroup label="' . __('Select Second', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][1])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][1];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][1])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][1]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<select name="iTunesCategory[2]">' . "\n";
         echo '						<optgroup label="' . __('Select Third', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][2])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][2];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][2])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][2]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesExplicit">' . __('iTunes:Explicit', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesExplicit" name="iTunesExplicit" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesExplicit'] == '##Global##' || empty($data['iTunesExplicit'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['explicit'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesExplicit'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesExplicit'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '						<option value="Clean" ';
         if ($data['iTunesExplicit'] == 'Clean') {
             echo 'selected="selected"';
         }
         echo '>' . __('Clean', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesExplicitHelp">' . "\n";
         echo '					' . __('Setting to indicate (in iTunes) whether or not your podcast contains explicit language or adult content', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - no indicator will show up', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - an "EXPLICIT" parental advisory graphic will appear next to your podcast artwork or name in iTunes', 'podpress') . "\n";
         echo '					<br/>' . __('"Clean" - means that you are sure that no explicit language or adult content is included any of the episodes, and a "CLEAN" graphic will appear', 'podpress') . "\n";
         echo '					<p>' . __('You have also the possibility to adjust this option for each post or page with at least one podcast episode (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesBlock">' . __('iTunes:Block', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesBlock" name="iTunesBlock" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesBlock'] != '##Global##' || empty($data['itunesBlock'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['block'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesBlock'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesBlock'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="itunesBlockHelp">' . "\n";
         echo '					' . __('Use this if you are no longer creating a podcast and you want it removed from the iTunes Store.', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - the podcast appears in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - prevent the entire podcast from appearing in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<p>' . __('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesFeedID">' . __('iTunes:FeedID', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<input name="iTunesFeedID" id="iTunesFeedID" type="text" value="' . attribute_escape($data['iTunesFeedID']) . '" size="10" /> ' . __('(Only relevant for the podPress Feed Buttons widget)', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesNewFeedURL">' . __('iTunes:New-Feed-Url', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td>';
         echo '					<select name="iTunesNewFeedURL" id="iTunesNewFeedURL">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesNewFeedURL'] == '##Global##' || empty($data['iTunesNewFeedURL'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Disable" ';
         if ($data['iTunesNewFeedURL'] == 'Disable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Disable', 'podpress') . '</option>' . "\n";
         echo '						<option value="Enable" ';
         if ($data['iTunesNewFeedURL'] == 'Enable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Enable', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>';
         echo '				<td>';
         echo '					' . __('If you want to change the URL of your podcast feed which you have used in the iTunes Store then change the "Podcast Feed URL" and set this option to "Enable" until the iTunes Store recognizes the new URL. This may take several days. "Enable" will add the <code>&lt;itunes:new-feed-url&gt;</code> tag to the RSS feeds and set the "Podcast Feed URL" as the new URL. For further information about "<a href="http://www.apple.com/itunes/podcasts/specs.html#changing" title="iTunes Podcasting Resources: Changing Your Feed URL" target="_blank">Changing Your Feed URL</a>" read on in the <a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank" title="iTunes Podcasting Resources: Making a Podcast">iTunes Podcasting Resources</a>.', 'podpress') . "\n";
         echo '					<p><label for="podcastFeedURL"><strong>' . __('the new Feed URL', 'podpress') . '</strong></label>';
         echo '					<br/>';
         echo '					<input type="text" id="podcastFeedURL" name="podcastFeedURL" class="podpress_wide_text_field" size="40" value="' . attribute_escape($data['podcastFeedURL']) . '" /><br />' . __('The URL of your Podcast Feed. If you want to register your podcast at the iTunes Store or if your podcast is already listed there then this input field should contain the same URL as in the iTunes Store settings. If you want change the URL at the iTunes Store then please read first the help text of the iTunes:New-Feed-Url option.', 'podpress');
         echo '					<br /><input type="button" value="' . __('Validate your Feed', 'podpress') . '" onclick="javascript: if(document.getElementById(\'podcastFeedURL\').value != \'\') { window.open(\'http://www.feedvalidator.org/check.cgi?url=\'+document.getElementById(\'podcastFeedURL\').value); }"/>' . "\n";
         echo '				</p></td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('General Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blognameChoice">' . __('Podcast title / Feed title', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blognameChoice" name="blognameChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Append" ';
         if ($data['blognameChoice'] == 'Append' || empty($data['blognameChoice'])) {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use the Site Title and append the name of the %1$s', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '						<option value="Global" ';
         if ($data['blognameChoice'] == 'Global') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the Site Title', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryName" ';
         if ($data['blognameChoice'] == 'CategoryName') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the name of the category', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogname" value="' . attribute_escape(stripslashes(get_option('blogname'))) . '" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blogdescriptionChoice">' . __('Description (Tagline)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blogdescriptionChoice" name="blogdescriptionChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['blogdescriptionChoice'] != 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryDescription" ';
         if ($data['blogdescriptionChoice'] == 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use %1$s Description', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogdescription" value="' . attribute_escape(stripslashes(get_option('blogdescription'))) . '" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_imageChoice">' . __('Blog/RSS Image (144 x 144 pixels)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_imageChoice" name="rss_imageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_imageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_imageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_imageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="rss_image" type="text" name="rss_image" value="' . $data['rss_image'] . '" class="podpress_wide_text_field" size="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_rss_image" type="hidden" value="' . get_option('rss_image') . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="rss_image_Display" style="width:144px; height:144px;" alt="' . __('Podcast Image - Small (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_language">' . __('Language', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         $langs = podPress_itunesLanguageArray();
         echo '					<select id="rss_language" name="rss_language" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Language', 'podpress') . '">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['rss_language'] == '##Global##' || empty($data['rss_language'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' - ' . $langs[get_option('rss_language')] . ' [' . get_option('rss_language') . ']</option>' . "\n";
         podPress_itunesLanguageOptions($data['rss_language']);
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_rss_language" value="' . $langs[get_option('rss_language')] . '[' . attribute_escape(get_option('rss_language')) . ']" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('Further Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_copyrightChoice">' . __('Feed Copyright / license name', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_copyrightChoice" name="rss_copyrightChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_copyrightChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_copyright'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_copyrightChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_copyrightWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="rss_copyright" class="podpress_wide_text_field" size="40" id="rss_copyright" value="' . attribute_escape(stripslashes($data['rss_copyright'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_copyright" value="' . attribute_escape(stripslashes($this->settings['rss_copyright'])) . '" />' . "\n";
         echo '					<div id="rss_copyrightHelp">' . "\n";
         echo '						' . __('Enter the copyright string or license name. For example: Copyright &#169 by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress') . "\n";
         echo '						<p>' . "\n";
         echo '						' . __('Used if this copyright phrase should be different than the global copyright phrase.', 'podpress') . "\n";
         echo '						</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_license_urlChoice">' . __('URL to the full Copyright / license text', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_license_urlChoice" name="rss_license_urlChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_license_urlChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_license_url'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_license_urlChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_license_urlWrapper" style="display: none;">' . "\n";
         echo '						<input name="rss_license_url" type="text" id="rss_license_url" class="podpress_wide_text_field" value="' . attribute_escape($data['rss_license_url']) . '" size="65%" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_license_url" value="' . attribute_escape($this->settings['rss_license_url']) . '" />' . "\n";
         echo '					<div id="rss_license_urlHelp">' . "\n";
         echo '						' . __('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress') . "\n";
         echo '						<p>' . __('Used if this license URL should be different than the global license URL.', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         $filetypes = podPress_filetypes();
         $selected_types = $data['FileTypes'];
         if (FALSE === is_array($data['FileTypes'])) {
             $selected_types = array();
         }
         echo '				<th>';
         echo '				' . __('inlude only files of this(these) type(s)', 'podpress');
         echo '				</th>' . "\n";
         echo '				<td>';
         echo '					<select id="filenameextensionfilter" name="FileTypes[]" size="5" multiple="multiple" style="height:15em;">' . "\n";
         echo '					<optgroup label="' . attribute_escape(__('Select file types', 'podpress')) . '">' . "\n";
         foreach ($filetypes as $key => $value) {
             if (TRUE == in_array($key, $selected_types)) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             if ($key !== 'audio_mp4') {
                 echo '						<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
             }
         }
         echo '					</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('You can select one or more media file types and limit by this choice the number of posts which will appear in the this Feed. For instance: if you select MP4 Video then this Feed will only contain posts (of this category) with MP4 files. If a post has also files of other types then only the files of the selected type will be attached in this feed. (This filter bypasses the "Included in:" selection.)', 'podpress') . '</p><p>' . __('Hold the key [SHIFT] or [CTRL] and use the left mouse button to select more than one value.<br />Hold [CTRL] and use the left mouse button to deselect values.', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '				<label for="show_only_podPress_podcasts">' . __('Include only posts with podPress attachments in this Feed', 'podpress') . '</label>' . "\n";
         echo '				</th>' . "\n";
         echo '				<td>';
         if (TRUE == isset($data['show_only_podPress_podcasts']) and FALSE === $data['show_only_podPress_podcasts']) {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" />' . "\n";
         } else {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" checked="checked" />' . "\n";
         }
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('works only while the File Type Filter is not in use', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		</fieldset>' . "\n";
         echo '	</div>' . "\n";
         echo '<script type="text/javascript">podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\'); </script>';
         echo '</div>' . "\n";
     }
 }
Exemple #19
0
function prologue_recent_projects($num_to_show = 35, $before = '', $after = '')
{
    $cache = wp_cache_get('prologue_theme_tag_list', '');
    if (!empty($cache[$num_to_show])) {
        $recent_tags = $cache[$num_to_show];
    } else {
        $all_tags = (array) get_tags(array('get' => 'all'));
        $recent_tags = array();
        foreach ($all_tags as $tag) {
            if ($tag->count < 1) {
                continue;
            }
            $tag_posts = get_objects_in_term($tag->term_id, 'post_tag');
            $recent_post_id = max($tag_posts);
            $recent_tags[$tag->term_id] = $recent_post_id;
        }
        arsort($recent_tags);
        $num_tags = count($recent_tags);
        if ($num_tags > $num_to_show) {
            $reduce_by = (int) $num_tags - $num_to_show;
            for ($i = 0; $i < $reduce_by; $i++) {
                array_pop($recent_tags);
            }
        }
        wp_cache_set('prologue_theme_tag_list', array($num_to_show => $recent_tags));
    }
    echo $before;
    echo "<ul>\n";
    foreach ($recent_tags as $term_id => $post_id) {
        $tag = get_term($term_id, 'post_tag');
        $tag_link = get_tag_link($tag->term_id);
        ?>

<li>
<a class="rss" href="<?php 
        echo get_tag_feed_link($tag->term_id);
        ?>
">RSS</a>&nbsp;<a href="<?php 
        echo $tag_link;
        ?>
"><?php 
        echo $tag->name;
        ?>
</a>&nbsp;(&nbsp;<?php 
        echo $tag->count;
        ?>
&nbsp;)
</li>

<?php 
    }
    // foreach get_tags
    ?>

	</ul>

<p><a class="allrss" href="<?php 
    bloginfo('rss2_url');
    ?>
">All Updates RSS</a></p>

<?php 
    echo $after;
}
Exemple #20
0
<?php

/**
 * The template used to display Tag Archive pages
 */
get_header();
?>

		<div id="content" class="grid_8" role="main">

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

			<p class="subscribe tag-subscribe"><a href="<?php 
    echo esc_url(get_tag_feed_link(get_queried_object_id()));
    ?>
">Follow this topic</a></p>

			<h1 class="page-title"><?php 
    single_tag_title();
    ?>
</h1>

			<?php 
    $tag_description = tag_description();
    if ($tag_description) {
        echo '<div class="topic-background">' . $tag_description . '</div>';
    }
    ?>
Exemple #21
0
 function recent_tags($num_to_show)
 {
     $cache = wp_cache_get('p2_recent_tags', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (isset($cache[$num_to_show]) && is_array($cache[$num_to_show])) {
         return $cache[$num_to_show];
     }
     $all_tags = (array) get_tags(array('get' => 'all'));
     $post_ids_and_tags = array();
     foreach ($all_tags as $tag) {
         if ($tag->count < 1) {
             continue;
         }
         $recent_post_id = max(get_objects_in_term($tag->term_id, 'post_tag'));
         $post_ids_and_tags[] = array('post_id' => $recent_post_id, 'tag' => $tag);
     }
     usort($post_ids_and_tags, create_function('$a, $b', 'return $b["post_id"] - $a["post_id"];'));
     $post_ids_and_tags = array_slice($post_ids_and_tags, 0, $num_to_show);
     $recent_tags = array();
     foreach ($post_ids_and_tags as $v) {
         $recent_tags[] = array('tag' => $v['tag'], 'link' => get_tag_link($v['tag']->term_id), 'feed_link' => get_tag_feed_link($v['tag']->term_id));
     }
     $cache[$num_to_show] = $recent_tags;
     wp_cache_add('p2_recent_tags', $cache, 'widget');
     return $recent_tags;
 }
Exemple #22
0
if (have_posts()) {
    ?>

			<header class="page-header">
				<h1 class="page-title">
					<?php 
    if (is_category()) {
        single_cat_title();
        $category = get_category(get_query_var('cat'));
        if (!empty($category)) {
            echo '<span><a href="' . get_category_feed_link($category->cat_ID) . '" title="' . sprintf(__('Suivre le fil de la catégorie : %1$s', 'appthemes'), $category->name) . '" rel="nofollow"><i class="ico-rss"></i></a></span>';
        }
    } elseif (is_tag()) {
        single_tag_title();
        $theID = intval(get_query_var('tag_id'));
        $rss_link = get_tag_feed_link($theID);
        $rss_description = 'Suivre le fil du tag : ' . single_tag_title("", false);
        if (!empty($theID)) {
            echo '<span><a href="' . $rss_link . '" title="' . $rss_description . '" rel="nofollow"><i class="ico-rss"></i></a></span>';
        }
    } elseif (is_author()) {
        $author = isset($_GET['author_name']) ? get_userdatabylogin($author_name) : get_userdata(intval($author));
        $author_title = 'Les articles de ' . $author->nickname;
        $rss_link = get_author_feed_link($author->ID);
        $rss_description = 'Suivre le fil de ' . $author->nickname;
        if (!empty($author)) {
            echo '' . $author_title . '<span><a href="' . $rss_link . '" title="' . $rss_description . '" rel="nofollow"><i class="ico-rss"></i></a></span>';
        }
        rewind_posts();
    } elseif (is_day()) {
        printf(__('Jour : %s', 'athemes'), '<span>' . get_the_date() . '</span>');