Exemple #1
0
/**
 * Function to add the viewed count to the post content. Filters `the_content`.
 *
 * @since	1.0
 * @param	string	$content	Post content
 * @return	string	Filtered post content
 */
function tptn_pc_content($content)
{
    global $single, $post, $tptn_settings;
    $exclude_on_post_ids = explode(',', $tptn_settings['exclude_on_post_ids']);
    if (in_array($post->ID, $exclude_on_post_ids)) {
        return $content;
        // Exit without adding related posts
    }
    if (is_single() && $tptn_settings['add_to_content']) {
        return $content . echo_tptn_post_count(0);
    } elseif (is_page() && $tptn_settings['count_on_pages']) {
        return $content . echo_tptn_post_count(0);
    } elseif (is_home() && $tptn_settings['add_to_home']) {
        return $content . echo_tptn_post_count(0);
    } elseif (is_category() && $tptn_settings['add_to_category_archives']) {
        return $content . echo_tptn_post_count(0);
    } elseif (is_tag() && $tptn_settings['add_to_tag_archives']) {
        return $content . echo_tptn_post_count(0);
    } elseif ((is_tax() || is_author() || is_date()) && $tptn_settings['add_to_archives']) {
        return $content . echo_tptn_post_count(0);
    } else {
        return $content;
    }
}
															<span class="entry-date">
																<i class="pw-icon-clock"></i>
																
																<a href="<?php 
            the_permalink();
            ?>
" rel="bookmark">
																	<time class="entry-date" datetime="2012-02-13T04:34:10+00:00"><?php 
            echo get_the_date();
            ?>
</time>
																</a>
															</span>
															<span class="read-time"><i class="pw-icon-eye"></i></span><?php 
            if (function_exists('echo_tptn_post_count')) {
                echo_tptn_post_count();
            }
            ?>
															<span class="comment-link">
																<i class="pw-icon-comment"></i>
																
																<?php 
            comments_popup_link(__('0 Comment', 'read'), __('1 Comment', 'read'), __('% Comments', 'read'));
            ?>
															</span>
															
															<span class="read-time"><i class="pw-icon-bookmark-empty-1"></i><span class="eta"></span> <?php 
            echo __('read', 'read');
            ?>
</span>