function custom_views() { $lect = ""; if (function_exists('the_views')) { if (the_views() != "") { $lect = the_views(false); } } return $lect; }
function widget($args, $instance) { extract($args); $limit = strip_tags($instance['limit']); $limit = $limit ? $limit : 10; ?> <div class="widget widget-populars"> <h3>热门文章</h3> <ul class="list"> <?php $args = array('paged' => 1, 'meta_key' => 'views', 'orderby' => 'meta_value_num', 'ignore_sticky_posts' => 1, 'post_type' => 'post', 'post_status' => 'publish', 'showposts' => $limit); $posts = query_posts($args); ?> <?php while (have_posts()) { the_post(); ?> <li class="widget-popular"> <p> <a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a> <span>[<?php if (function_exists('the_views')) { the_views(); } ?> ]</span> </p> </li> <?php } wp_reset_query(); $posts = null; ?> </ul> </div> <?php }
function makeThumb($post_id, $titre = "long", $taille = 2) { //genere les blocs videos echo '<div class="col-md-' . $taille . ' col-sm-' . $taille . ' col-xs-12"> <div class="thumb"> <a href="' . get_permalink() . '" title="' . get_the_title() . '" >'; echo get_the_post_thumbnail($post_id, 'thumbnail', array('class' => 'img-responsive')); echo '<span class="overlay"></span> </a>'; if (function_exists('the_views')) { echo '<span class="viewCounter"> <i class="glyphicon glyphicon-eye-open"></i> ' . the_views(false) . ' </span>'; } echo '</div><div class="thumbData"> <h3 class="thumbTitle"><a href="' . get_permalink() . '" title="' . get_the_title() . '" >'; if ($titre == 'global') { the_title(); } else { getSceneTitle($post_id, $titre, true); } echo '</a></h3>'; echo '</div></div>'; }
/** * Prints HTML with meta information for the current post-date/time and author, * comment and edit link * * @author Konstantin Obenland * @since 1.0.0 - 05.02.2012 * * @return void */ function the_bootstrap_posted_on() { // CUSTOM CODE echo '<span class="sep">'; the_views(); echo '</span><span class="sep"> | </span>'; // CUSTOM CODE DONE printf(__('<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'the-bootstrap'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'the-bootstrap'), get_the_author())), get_the_author()); if (comments_open() and !post_password_required()) { ?> <span class="sep"> | </span> <span class="comments-link"> <?php comments_popup_link('<span class="leave-reply">' . __('Leave a reply', 'the-bootstrap') . '</span>', __('<strong>1</strong> Reply', 'the-bootstrap'), __('<strong>%</strong> Replies', 'the-bootstrap')); ?> </span> <?php } edit_post_link(__('Edit', 'the-bootstrap'), '<span class="sep"> </span><span class="edit-link label">', '</span>'); }
// Обратите внимание: Мы не будет открывать div, если у него не будет содержимого if ( '' != $taxo_text ) { ?> <div class="entry"> <?php echo $taxo_text; ?> </div> <? } // endif ?> <?php the_content('Читать полностью...'); ?><div class="clear"></div> <?php if(function_exists('the_ratings')) { echo '<div class="ratings"><strong>Рейтинг:</strong>'; the_ratings(); echo '</div>'; } ?> <?php if(function_exists('the_views')) { echo '<div class="views"> '; the_views(); echo '</div>'; } ?> <?php wp_link_pages(array('before' => '<p><strong>Страницы:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Редактировать', '<p class="edit">', '</p>'); ?> </div> <?php the_tags('<div class="tags">Метки: ', ', ', '</div><div class="clear"></div>'); ?> </div> <div class="post_follow"> Если Вам интересна эта запись, Вы можете следить за ее обсуждением, подписавшись на <?php post_comments_feed_link('RSS 2.0'); ?> . <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { ?> <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { ?> <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { ?>
function get_views() { $buffy = ''; if (td_util::get_option('tds_p_show_views') != 'hide') { $buffy .= '<div class="td-post-views">'; $buffy .= '<i class="td-icon-views"></i>'; // WP-Post Views Counter if (function_exists('the_views')) { $post_views = the_views(false); $buffy .= $post_views; } else { $buffy .= '<span class="td-nr-views-' . $this->post->ID . '">' . td_page_views::get_page_views($this->post->ID) . '</span>'; } $buffy .= '</div>'; } return $buffy; }
<h1 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h1> <!-- post-info --> <div class="post-info"> <span id="view-post"> <i class="fa fa-eye"></i> <!-- post views --> <?php if (function_exists('the_views')) { the_views(true, '', '', false, true); } ?> </span> <?php if ('post' == get_post_type()) { ?> <!-- comments in post count --> <span id="coment-count"> <i class="fa fa-comment"></i> <?php comments_number(0, 1, '%'); ?> </span> </div>
function widget($args, $instance) { extract($args); @($title1 = $instance['title1'] ? $instance['title1'] : '最热文章'); @($title2 = $instance['title2'] ? $instance['title2'] : '最新文章'); @($title3 = $instance['title3'] ? $instance['title3'] : '随机文章'); @($num = $instance['num'] ? $instance['num'] : 8); echo $before_widget; ?> <div class="panel panel-zan widget-sets hidden-xs"> <ul class="nav nav-pills pills-zan"> <li class="active"><a href="#sidebar-hot" data-toggle="tab"><?php echo $title1; ?> </a></li> <li><a href="#sidebar-new" data-toggle="tab"><?php echo $title2; ?> </a></li> <li><a href="#sidebar-rand" data-toggle="tab"><?php echo $title3; ?> </a></li> </ul> <div class="tab-content"> <div class="tab-pane active nav bs-sidenav fade in" id="sidebar-hot"> <ul class="list-group"> <?php // 设置全局变量,实现post整体赋值 global $post; $posts = zan_get_hotest_posts($num); foreach ($posts as $post) { setup_postdata($post); ?> <li class="list-group-item clearfix"> <a href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> <span class="badge"> <?php if (function_exists('the_views')) { the_views(); } ?> </span> </li> <?php } wp_reset_postdata(); ?> </ul> </div> <div class="tab-pane fade" id="sidebar-new"> <ul class="list-group"> <?php // 设置全局变量,实现post整体赋值 global $post; $posts = zan_get_latest_posts($num); foreach ($posts as $post) { setup_postdata($post); ?> <li class="list-group-item clearfix"> <a href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> <span class="badge"> <?php if (function_exists('the_views')) { the_views(); } ?> </span> </li> <?php } wp_reset_postdata(); ?> </ul> </div> <div class="tab-pane nav bs-sidenav fade" id="sidebar-rand"> <ul class="list-group"> <?php // 设置全局变量,实现post整体赋值 global $post; $posts = zan_get_rand_posts($num); foreach ($posts as $post) { setup_postdata($post); ?> <li class="list-group-item clearfix"> <a href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> <span class="badge"> <?php if (function_exists('the_views')) { the_views(); } ?> </span> </li> <?php } wp_reset_postdata(); ?> </ul> </div> </div> </div> <?php echo $after_widget; }
the_author_posts_link(); ?> <?php } ?> <?php if ($options['categories']) { ?> | <?php _e('Filed under ', 'blocks2'); the_category(', '); ?> <?php } ?> </div> <div class="comments"> <?php if (function_exists('the_views')) { the_views(true, '', ' | '); } comments_popup_link(__('No comments', 'blocks2'), __('1 comment', 'blocks2'), __('% comments', 'blocks2')); edit_post_link(__('Edit', 'blocks2'), ' | ', ''); ?> </div> <div class="fixed"></div> </div> <div class="content"> <?php the_content(__('Read more...', 'blocks2'));
* @subpackage Twenty_Eleven */ get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php if ( have_posts() ) : ?> <?php twentyeleven_content_nav( 'nav-above' ); ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php if(function_exists('the_views')) { the_views(); } ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentyeleven_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content">
" ><?php the_title(); ?> </a></h2> <div class="row"> <div class="span1"><span class="label label-info"><?php the_time('m-d'); ?> </span></div> <div class="span1"><span class="label label-info"><?php comments_number('0', '1', '%'); ?> 人评论</span></div> <div class="span1"><span class="label label-info"><?php if (function_exists('the_views')) { echo the_views(); } ?> </span></div> </div> <?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 136, '...'); ?> <br /> <?php dm_the_thumbnail(); ?> </div> </div> <?php }
?> <?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 330, "..."); ?> <span class="more">[<a href="<?php the_permalink(); ?> " title="详细阅读 <?php the_title(); ?> " rel="bookmark">阅读全文</a>]</span> </div> <div class="meta"> <span class="meat_span"><i class="iconfont">ė</i><?php if (function_exists(the_views)) { the_views('次浏览', true); } ?> </span> <span class="meat_span"><i class="iconfont">6</i><?php comments_popup_link('没有评论', '1条评论', '%条评论'); ?> </span> <span class="meat_span meat_max"><i class="iconfont">0</i><?php the_tags('', ', ', ''); ?> </span> </div> </div> <?php }
/** * 生成DOM树 * */ function rbn_dom() { if (!is_admin()) { $base_url = get_bloginfo('wpurl'); ?> <div id="plugin_rbn"> <div id="rbn_head_and_body"> <div id="rbn_head"> <div class="rbn_post_hot cur_rbn">热点</div><div class="rbn_post_new">最新</div><div class="rbn_post_random">随机</div><div class="rbn_weather">天气</div> <div id="rbn_close"></div> </div> <div id="rbn_body"> <div class="cur_rbn"> <ol class="list_hot"> <?php $rbn_posts = new WP_Query('orderby=comment_count&caller_get_posts=4&posts_per_page=3'); while ($rbn_posts->have_posts()) { $rbn_posts->the_post(); ?> <li> <div class="img_wraper"> <?php preg_match_all('~<img [^\\>]*\\ />~', get_the_content(), $imgs); if (count($imgs[0]) > 0) { echo $imgs[0][0]; } else { echo '<img alt="" src="', $base_url, '/wp-content/plugins/right_bottom_nav/rbn_default.png', '" />'; } ?> </div> <div class='post_info'> <label><a class="plink" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></label><br/> <label class='author'><?php the_author(); ?> </label><label class='ptime'> 于 <?php the_time('m月d日'); ?> </label><br/> <label class="pv_and_comment_num"><?php if (function_exists('the_views')) { echo '访问', the_views(), ' '; } echo comments_number('暂无评论', '评论 1', '评论 %'); ?> </label> </div> </li> <?php } ?> </ol> </div> <div> <ol class="list_new"> <?php $rbn_posts = new WP_Query('numberposts=10&offset=0'); while ($rbn_posts->have_posts()) { $rbn_posts->the_post(); ?> <li><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></li></li><?php } ?> </ol> </div> <div> <ul class="list_rand"> <?php $rbn_posts = new WP_Query('numberposts=10&orderby=rand'); while ($rbn_posts->have_posts()) { $rbn_posts->the_post(); ?> <li><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a><label class="ptime"><?php the_time('m月d日'); ?> </label></li></li><?php } ?> </ul> </div> <div id="rbn_weather_show_div"></div> </div> </div> <div id="rbn_foot"> <div class="left"> <ul id="right_bottom_nav"> <li class="rbn_post_hot cur_rbn"></li><!-- 热点 --> <li class="rbn_post_new"></li><!-- 最新 --> <li class="rbn_post_random"></li><!-- 随机 --> <li class="rbn_weather"></li><!-- 天气 --> </ul> </div> <div class="right"> <ul id="rbn_foot_right_menu"> <li id="rbn_top_btn"></li><!-- 回顶部 --> <li id="rbn_toggle_btn"></li> <li id="rbn_bottom_btn"></li><!-- 到底部 --> </ul> </div> </div> <div id="rbn_foot_tip"></div> </div> <?php } }
/** * Post views */ function mutheme_views() { if (function_exists('the_views')) { ?> <li class="inline-li"><span class="post-span">·</span></li> <li class="inline-li"><?php the_views(); ?> </li> <?php } }
function get_film_home($type, $num = 28, $excerpt_length = 40) { global $post; // tao cache query_posts('post_type=post&showposts=' . $num . '&meta_key=phim_loai&meta_value=' . $type . '&paged=' . $q . '&order=desc'); while (have_posts()) { the_post(); $html .= '<li><div class="inner"><a data-tooltip=" <span class=\'title\'>' . get_the_title() . '</span><br /> ' . get_excerpt_content(60, '', 0, $post->post_content) . ' " href="' . get_permalink() . '" title="' . get_the_title() . '"> <img src="' . img3(146, 195) . '" alt="' . get_the_title() . '"/></a> <div class="info"><div class="name"><h3><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></h3> </div> <div class="name2"><h4>' . get_post_meta($post->ID, "phim_en", true) . '</h4></div> <div class="stats"><span class="liked">' . the_views($post_views->ID) . ' </span></div> <h5 style="text-indent:-9999px;">' . get_excerpt_content($excerpt_length, '', 0, $post->post_content) . '</h5></div> <!-- <div class="status"><span class="status_r">' . get_post_meta($post->ID, "phim_tl", true) . '</span></div> <div class="g-status"><span class="status_g">' . get_post_meta($post->ID, "phim_nsx", true) . '</span></div> --> <div class="f_tag"> <div class="f_t_f"></div> <div class="f_t_c">' . get_post_meta($post->ID, "phim_tl", true) . '</div> <div class="f_t_e"></div> <div class="clr"></div> </div> <div class="f_tag g-year"> <div class="f_t_f"></div> <div class="f_t_c">' . get_post_meta($post->ID, "phim_nsx", true) . '</div> <div class="f_t_e"></div> <div class="clr"></div> </div> </div></li> '; } wp_reset_query(); return $html; }
function get_commentsAndViews() { $buffy = ''; $buffy .= '<div class="entry-comments-views">'; if (td_util::get_option('tds_p_show_comments') != 'hide') { //$buffy .= '<a href="' . get_comments_link($this->post->ID) . '">'; $buffy .= '<span class="td-sp td-sp-ico-comments td-fake-click" data-fake-click="' . get_comments_link($this->post->ID) . '"></span>'; $buffy .= get_comments_number($this->post->ID); //$buffy .= '</a>'; } if (td_util::get_option('tds_p_show_views') != 'hide') { $buffy .= ' '; $buffy .= '<span class="td-sp td-sp-ico-view"></span>'; // WP-Post Views Counter if (function_exists('the_views')) { $post_views = the_views(false); $buffy .= $post_views; } else { $buffy .= '<span class="td-nr-views-' . $this->post->ID . '">' . td_page_views::get_page_views($this->post->ID) . '</span>'; } } $buffy .= '</div>'; return $buffy; }
?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a></h2> <div class="postinfo"> <div class="info">Опубликовал <?php the_author_posts_link(); ?> <?php the_time('j F, Y'); ?> <? if(function_exists('the_views')) {the_views();} ?></div> <div class="commentnum"><?php comments_popup_link('Прокомментировать »', '1 комментарий »', '% коммент. »'); ?> </div><div class="clear"></div> </div> <div class="category">Размещено в рубрике <?php the_category(', '); ?> </div> <div class="entry"> <?php the_content('Читать далее...'); ?> <div class="clear"></div>
<!--插件图标--> <div id="addon-icon"><img src="<?php the_field('addon_icon'); ?> " title="<?php the_title(); ?> " alt="<?php the_title(); ?> " width="1125px" height="200px" /></div> <!--插件标签--> <div id="addon-meta"> <span id="cloudid-box"><span id="yylmacro-meta-cloudid" class="yylmacro-meta">下载次数:</span><span id="cloudid"><?php the_views($display = true, $prefix = '', $postfix = '', $always = false); ?> </span></span> <span class="yylmacro-meta">更新日期</span> <?php the_modified_time('Ymd'); ?> <span class="yylmacro-meta">插件作者</span> <?php the_field('addon_author'); ?> <span class="yylmacro-meta">插件版本</span> <?php the_field('addon_version'); ?> <span class="yylmacro-meta">官方主页</span> <a href="<?php the_field('addon_authorlink'); ?> " target="_blank">点击访问</a>
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } $number = strip_tags($instance['number']) ? absint($instance['number']) : 5; ?> <div id="hot" class="hot_commend"> <ul> <?php query_posts(array('meta_key' => 'hot', 'showposts' => $number, 'orderby' => rand, 'caller_get_posts' => 1)); while (have_posts()) { the_post(); ?> <li> <figure class="thumbnail"> <?php get_template_part('inc/thumbnail'); ?> </figure> <div class="hot-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title="<?php the_title(); ?> "><?php the_title(); ?> </a></div> <?php if (function_exists('the_views')) { print '<div class="views"><i class="icon-views"></i>阅读 '; the_views(); print ' 次</div>'; } ?> </li> <?php } ?> <div class="clear"></div> </ul> </div> <?php echo $after_widget; }
function mystique_post() { global $post, $id, $comment; $category = get_the_category(); $category_name = $category[0]->cat_name; if (!empty($category_name)) { $category_link = '<a href="' . get_category_link($category[0]->cat_ID) . '">' . $category_name . '</a>'; } else { $category_link = "[...]"; } $post_tags = get_the_tags(); $post_settings = apply_filters('mystique_post_settings', get_option("mystique")); $comment_count = mystique_comment_count('comments'); do_action('mystique_before_post'); ?> <!-- post --> <div id="post-<?php the_ID(); ?> " class="<?php mystique_post_class('clear-block'); ?> "> <?php $post_thumb = mystique_post_thumb(); if ($post_settings['post_title']) { $title_url = get_post_meta($post->ID, 'title_url', true); ?> <h2 class="title"><a href="<?php if ($title_url) { echo $title_url; } else { the_permalink(); } ?> " rel="bookmark" title="<?php _e('Permanent Link:', 'mystique'); echo ' '; the_title_attribute(); ?> "><?php the_title(); ?> </a></h2> <?php } ?> <?php if ($post_settings['post_info'] && !get_post_meta($post->ID, 'asides', true)) { ?> <div class="post-date"> <p class="day"><?php the_time(__('M jS', 'mystique')); ?> </p> </div> <div class="post-info clear-block <?php if ($post_thumb) { echo 'with-thumbs'; } ?> "> <p class="author alignleft"><?php printf(__('Posted by %1$s in %2$s', 'mystique'), '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . sprintf(__("Posts by %s", "mystique"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>', $category_link); ?> <?php if (function_exists('the_views')) { ?> <span class="postviews">| <?php the_views(); ?> </span><?php } ?> <?php edit_post_link(__('Edit', 'mystique'), ' | '); ?> </p> <?php if (comments_open() || $comment_count > 0) { ?> <p class="comments alignright"><a href="<?php the_permalink(); ?> #comments" class="<?php if ($comment_count < 1) { echo "no"; } ?> comments"><?php comments_number(__('No comments', 'mystique'), __('1 comment', 'mystique'), __('% comments', 'mystique')); ?> </a></p> <?php } ?> </div> <?php } ?> <?php if ($post_settings['post_content']) { ?> <div class="post-content clear-block"> <?php if ($post_settings['post_content_length'] == 'f') { the_content(__('More >', 'mystique')); } elseif ($post_settings['post_content_length'] == 'e') { the_excerpt(); } else { $word_count = $post_settings['post_content_length']; // save original post content to variable $content = get_the_content(); // prevent tags strip | it's a bug in WordPress! $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); // throw out trimmed: content to process, read more tag, post permalink, words length echo mystique_trim_the_content($content, __('More >', 'mystique'), get_permalink($post->ID), $word_count); } ?> </div> <?php } ?> <?php if (function_exists('the_ratings')) { the_ratings(); } ?> <?php if ($post_tags && $post_settings['post_tags']) { ?> <div class="post-tags"> <?php $tags = array(); $i = 0; foreach ($post_tags as $tag) { $tags[$i] .= '<a href="' . get_tag_link($tag->term_id) . '" rel="tag" title="' . sprintf(__('%1$s (%2$s topics)'), $tag->name, $tag->count) . '">' . $tag->name . '</a>'; $i++; } echo implode(', ', $tags); ?> </div> <?php } ?> </div> <!-- /post --> <?php do_action('mystique_after_post'); }
function getPostViews($postID) { if (function_exists('the_views') && mom_option('views_by') == 'wpv') { the_views(false); } elseif (function_exists('stats_get_csv') && mom_option('views_by') == 'jetpack') { global $post; $args = array('days' => -1, 'limit' => -1, 'post_id' => $post->ID); $result = stats_get_csv('postviews', $args); $views = $result[0]['views']; return number_format_i18n($views) . ' ' . __('Views', 'framework'); } else { $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if ($count == '') { delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return "0 " . __('Views', 'framework'); } return $count . __(' Views', 'framework'); } }
<div class="m-infoarea clearfix"> <a class="time" href="<?php the_permalink(); ?> "><?php echo get_the_date(); ?> </a> <?php if (function_exists('the_views')) { ?> <a href="<?php the_permalink(); ?> " class="like"><?php echo the_views('Views', true); ?> </a> <?php } ?> <?php comments_popup_link('0', '1', '%', 'comment'); ?> <span class="sep">/</span> <div class="from"><span class="reblog"><?php the_category(' '); ?> </span></div> <span class="sep">/</span> <div class="tagarea clearfix">
/** * Prints HTML with meta information for the current post—date/time and author. * * @since Twenty Ten 1.0 */ function twentyten_posted_on() { $view_count = ''; if (function_exists('the_views')) { $view_count = '<span class="entry-eye">' . the_views(false) . '</span>'; } printf(__('%2$s %3$s %4$s %5$s', 'twentyten'), 'meta-prep meta-prep-author', sprintf('<span class="entry-date">发布时间:%3$s</span>', get_permalink(), esc_attr(get_the_time()), get_the_time('Y-m-d H:i')), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'twentyten'), get_the_author()), get_the_author()), sprintf('<span class="cat-links">%1$s</span>', get_the_category_list(', ')), sprintf($view_count)); }
$key = "feature"; echo get_post_meta($post->ID, $key, true); ?> " title="<?php the_title(); ?> " alt="<?php the_title(); ?> " width="115px" height="71px"> <small><?php the_time('j M Y'); ?> | <?php if (function_exists('the_views')) { the_views(); } ?> | <?php comments_popup_link('0 comentário', '1 comentário', 'Comentários'); ?> </small> <h1><a href="<?php the_Permalink(); ?> " title="<?php the_title(); ?> " alt="<?php the_title(); ?>
function bfa_postinfo($postinfo_string) { // one theme option needed below for nofollow trackback / RSS links yes/no global $bfa_ata, $post; /* replace date format escape placeholders(#) with the actual escpae character (=backslashes). This function removes all backslashes from post info strings to avoid issues with hosts that have magic_quotes_gpc ON. But we want to keep the backslashes inside date items, because they are needed to escape literal strings inside dates */ $postinfo_string = str_replace("#", "\\", $postinfo_string); $postinfo = $postinfo_string; // Author public name if (strpos($postinfo_string, '%author%') !== FALSE) { ob_start(); the_author(); $author = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author%", $author, $postinfo); } // Public name of Author who last modified a post, since WordPress 2.8. // Check first if function is available (= if this is WP 2.8+) if (function_exists('the_modified_author')) { if (strpos($postinfo_string, '%modified-author%') !== FALSE) { ob_start(); the_modified_author(); $modified_author = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%modified-author%", $modified_author, $postinfo); } } // Author about yourself if (strpos($postinfo_string, '%author-description%') !== FALSE) { ob_start(); the_author_meta('description'); $author_description = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-description%", $author_description, $postinfo); } // Author login name if (strpos($postinfo_string, '%author-login%') !== FALSE) { ob_start(); the_author_meta('user_login'); $author_login = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-login%", $author_login, $postinfo); } // Author first name if (strpos($postinfo_string, '%author-firstname%') !== FALSE) { ob_start(); the_author_meta('first_name'); $author_firstname = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-firstname%", $author_firstname, $postinfo); } // Author last name if (strpos($postinfo_string, '%author-lastname%') !== FALSE) { ob_start(); the_author_meta('last_name'); $author_lastname = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-lastname%", $author_lastname, $postinfo); } // Author nickname if (strpos($postinfo_string, '%author-nickname%') !== FALSE) { ob_start(); the_author_meta('nickname'); $author_nickname = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-nickname%", $author_nickname, $postinfo); } // Author ID if (strpos($postinfo_string, '%author-id%') !== FALSE) { ob_start(); the_author_meta('ID'); $author_ID = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-id%", $author_ID, $postinfo); } // Author email address, clear text in HTML source code if (strpos($postinfo_string, '%author-email-clear%') !== FALSE) { ob_start(); the_author_meta('email'); $author_email_clear = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-email-clear%", $author_email_clear, $postinfo); } // Author email address obfuscated if (strpos($postinfo_string, '%author-email%') !== FALSE) { $postinfo = str_replace("%author-email%", antispambot(get_the_author_email()), $postinfo); } // Author website URL if (strpos($postinfo_string, '%author-url%') !== FALSE) { ob_start(); the_author_meta('url'); $author_url = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-url%", $author_url, $postinfo); } // Author website link if (strpos($postinfo_string, '%author-link%') !== FALSE) { ob_start(); the_author_link(); $author_link = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-link%", $author_link, $postinfo); } // Author posts archive link if (strpos($postinfo_string, '%author-posts-link%') !== FALSE) { ob_start(); the_author_posts_link(); $author_posts_link = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-posts-link%", $author_posts_link, $postinfo); } // LEGACY: %author-linked% replaced by %author-posts-link% in 3.3.2, but displays the same: Author posts archive link if (strpos($postinfo_string, '%author-linked%') !== FALSE) { ob_start(); the_author_posts_link(); $author_posts_link = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-linked%", $author_posts_link, $postinfo); } // Author post count if (strpos($postinfo_string, '%author-post-count%') !== FALSE) { ob_start(); the_author_posts(); $author_post_count = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-post-count%", $author_post_count, $postinfo); } // Author AOL Instant Messenger screenname if (strpos($postinfo_string, '%author-aim%') !== FALSE) { ob_start(); the_author_meta('aim'); $author_aim = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-aim%", $author_aim, $postinfo); } // Author Yahoo IM ID if (strpos($postinfo_string, '%author-yim%') !== FALSE) { ob_start(); the_author_meta('yim'); $author_yim = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%author-yim%", $author_yim, $postinfo); } // Date & Time if (strpos($postinfo_string, '%date(') !== FALSE) { $postinfo = preg_replace_callback("/%date\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_callback", $postinfo); } // Date & Time, last modified if (strpos($postinfo_string, '%date-modified(') !== FALSE) { $postinfo = preg_replace_callback("/%date-modified\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_modified_callback", $postinfo); } // Tags, linked - since WP 2.3 if (strpos($postinfo_string, '%tags-linked') !== FALSE) { while (strpos($postinfo, '%tags-linked') !== FALSE) { $tag_link_options = preg_match("/(.*)%tags-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches); $tags_linked = get_the_tag_list($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]); $postinfo = preg_replace("/(.*)%tags-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_linked . "\${3}", $postinfo); } } // Tags, linked. If post has no tags, categories are displayed instead - since WP 2.3 if (strpos($postinfo_string, '%tags-cats-linked') !== FALSE) { while (strpos($postinfo, '%tags-cats-linked') !== FALSE) { $tag_link_options = preg_match("/(.*)%tags-cats-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches); ob_start(); the_tags($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]); $tags_cats_linked = ob_get_contents(); ob_end_clean(); $postinfo = preg_replace("/(.*)%tags-cats-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_cats_linked . "\${3}", $postinfo); } } // Tags, not linked - since WP 2.3 if (strpos($postinfo_string, '%tags(') !== FALSE) { while (strpos($postinfo, '%tags(') !== FALSE) { $tag_options = preg_match("/(.*)%tags\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_matches); $posttags = get_the_tags(); if ($posttags) { foreach ($posttags as $tag) { $tag_list .= $tag->name . $tag_matches[4]; } // remove last separator $tag_list = preg_replace("/" . $tag_matches[4] . "\$/mi", "", $tag_list); $tags = $tag_matches[2] . $tag_list . $tag_matches[6]; } else { $tags = ""; } $postinfo = preg_replace("/(.*)%tags\\((.*?)\\)%(.*)/i", "\${1}" . $tags . "\${3}", $postinfo); } } // 1st category if (strpos($postinfo_string, '%category%') !== FALSE) { $all_categories = get_the_category(); $category = $all_categories[0]->cat_name; $category_notlinked = $category; $postinfo = str_replace("%category%", $category_notlinked, $postinfo); } // 1st category, linked if (strpos($postinfo_string, '%category-linked%') !== FALSE) { $all_categories = get_the_category(); $category = $all_categories[0]->cat_name; $category_linked = '<a class="' . $category . '" href="' . get_category_link($all_categories[0]->cat_ID) . '">' . $category . '</a>'; $postinfo = str_replace("%category-linked%", $category_linked, $postinfo); } // Categories, linked with class name added $categories_linked = ''; if (strpos($postinfo_string, '%categories-linked') !== FALSE) { while (strpos($postinfo, '%categories-linked') !== FALSE) { $category_linked_separator = preg_match("/(.*)%categories-linked\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_linked_matches); ob_start(); $categories = get_the_category(); $items_in_categories = count($categories); $output = ''; $categories_count = $items_in_categories; if ($categories) { foreach ($categories as $category) { $categories_count -= 1; if ($categories_count) { $seperator = $category_linked_matches[2]; } else { $seperator = ''; } $categories_linked .= '<a class="' . $category->slug . '" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . $seperator . '</a>'; } } ob_end_clean(); $postinfo = preg_replace("/(.*)%categories-linked\\((.*?)\\)%(.*)/i", "\${1}" . $categories_linked . "\${3}", $postinfo); } } // Categories, not linked if (strpos($postinfo_string, '%categories(') !== FALSE) { while (strpos($postinfo, '%categories(') !== FALSE) { $category_separator = preg_match("/(.*)%categories\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_matches); $categories = ""; foreach (get_the_category() as $category) { $categories .= $category->cat_name . $category_matches[2]; } // remove last separator $categories = preg_replace("/" . $category_matches[2] . "\$/mi", "", $categories); $postinfo = preg_replace("/(.*)%categories\\((.*?)\\)%(.*)/i", "\${1}" . $categories . "\${3}", $postinfo); } } // Comment link if (strpos($postinfo_string, '%comments(') !== FALSE) { while (strpos($postinfo, '%comments(') !== FALSE) { $comment_options = preg_match("/(.*)%comments\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $comment_matches); if (!comments_open() and $comment_matches[8] == "dontshow") { $comment_link = ''; } else { ob_start(); comments_popup_link($comment_matches[2], $comment_matches[4], $comment_matches[6], 'comments-link', $comment_matches[8]); $comment_link = ob_get_contents(); ob_end_clean(); } if (!comments_open()) { if ($post->comment_count == 0) { $comment_link = '<strong>' . $comment_matches[8] . '</strong>'; } else { $comment_link = $comment_link . ' - <strong>(' . $comment_matches[8] . ')</strong>'; } } if (!comments_open() and $comment_matches[8] == "dontshow") { $comment_link = ''; } $postinfo = preg_replace("/(.*)%comments\\((.*?)\\)%(.*)/i", "\${1}" . $comment_link . "\${3}", $postinfo); } } // Comments Feed link if (strpos($postinfo_string, '%comments-rss') !== FALSE) { while (strpos($postinfo, '%comments-rss') !== FALSE) { $comments_rss_link_text = preg_match("/(.*)%comments-rss\\('(.*?)'(.*)/i", $postinfo_string, $comments_rss_matches); ob_start(); post_comments_feed_link($comments_rss_matches[2]); $comments_rss_link = ob_get_contents(); ob_end_clean(); // make link nofollow if set in theme options if ($bfa_ata['nofollow'] == "Yes") { $comments_rss_link = str_replace('href=', 'rel="nofollow" href=', $comments_rss_link); } $postinfo = preg_replace("/(.*)%comments-rss\\((.*?)\\)%(.*)/i", "\${1}" . $comments_rss_link . "\${3}", $postinfo); } } // Trackback URL if (strpos($postinfo_string, '%trackback%') !== FALSE) { $trackback_url = trackback_url(FALSE); $postinfo = str_replace("%trackback%", $trackback_url, $postinfo); } // Trackback Link if (strpos($postinfo_string, '%trackback-linked(') !== FALSE) { while (strpos($postinfo, '%trackback-linked(') !== FALSE) { $trackback_url = trackback_url(FALSE); $trackback_link_text = preg_match("/(.*)%trackback-linked\\('(.*?)'(.*)/i", $postinfo_string, $trackback_matches); $trackback_link = '<a href="' . $trackback_url . '">' . $trackback_matches[2] . '</a>'; // make link nofollow if set in theme options if ($bfa_ata['nofollow'] == "Yes") { $trackback_link = str_replace('href=', 'rel="nofollow" href=', $trackback_link); } $postinfo = preg_replace("/(.*)%trackback-linked\\((.*?)\\)%(.*)/i", "\${1}" . $trackback_link . "\${3}", $postinfo); } } // Trackback RDF if (strpos($postinfo_string, '%trackback-rdf%') !== FALSE) { ob_start(); trackback_rdf(); $trackback_rdf = "<!-- " . ob_get_contents() . " -->"; ob_end_clean(); $postinfo = str_replace("%trackback-rdf%", $trackback_rdf, $postinfo); } // Permalink if (strpos($postinfo_string, '%permalink%') !== FALSE) { ob_start(); the_permalink(); $permalink = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%permalink%", $permalink, $postinfo); } // Post ID if (strpos($postinfo_string, '%post-id%') !== FALSE) { ob_start(); the_ID(); $post_id = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%post-id%", $post_id, $postinfo); } // Post Title if (strpos($postinfo_string, '%post-title%') !== FALSE) { ob_start(); the_title(); $post_title = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%post-title%", $post_title, $postinfo); } // Edit post if (strpos($postinfo_string, '%edit(') !== FALSE) { while (strpos($postinfo, '%edit(') !== FALSE) { $edit_options = preg_match("/(.*)%edit\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $edit_matches); ob_start(); edit_post_link($edit_matches[4], $edit_matches[2], $edit_matches[6]); $edit_link = ob_get_contents(); ob_end_clean(); $postinfo = preg_replace("/(.*)%edit\\((.*?)\\)%(.*)/i", "\${1}" . $edit_link . "\${3}", $postinfo); } } // Print if (strpos($postinfo_string, '%print(') !== FALSE) { while (strpos($postinfo, '%print(') !== FALSE) { $print_text = preg_match("/(.*)%print\\('(.*?)'(.*)/i", $postinfo_string, $print_text_matches); $print_link = '<a href="javascript:window.print()">' . $print_text_matches[2] . '</a>'; $postinfo = preg_replace("/(.*)%print\\((.*?)\\)%(.*)/i", "\${1}" . $print_link . "\${3}", $postinfo); } } // For the "WP-Email" plugin if (strpos($postinfo_string, '%wp-email%') !== FALSE) { $wp_email = function_exists('wp_email') ? email_link($email_post_text = '', $email_page_text = '', $echo = FALSE) : ""; $postinfo = str_replace("%wp-email%", $wp_email, $postinfo); } // For the "WP-Print" plugin if (strpos($postinfo_string, '%wp-print%') !== FALSE) { $wp_print = function_exists('wp_print') ? print_link($print_post_text = '', $print_page_text = '', $echo = FALSE) : ""; $postinfo = str_replace("%wp-print%", $wp_print, $postinfo); } // For the "WP-PostViews" plugin if (strpos($postinfo_string, '%wp-postviews%') !== FALSE) { $wp_postviews = function_exists('the_views') ? the_views($display = FALSE) : ""; $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo); } // For the "WP-PostRatings" plugin if (strpos($postinfo_string, '%wp-postratings%') !== FALSE) { $wp_postratings = function_exists('the_ratings') ? the_ratings($start_tag = 'span', $custom_id = 0, $display = FALSE) : ""; $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo); } // For the "Sociable" plugin if (strpos($postinfo_string, '%sociable%') !== FALSE) { ob_start(); $sociable = (function_exists('sociable_html2') and function_exists(do_sociable())) ? do_sociable() : ""; $sociable = ob_get_contents(); ob_end_clean(); $postinfo = str_replace("%sociable%", $sociable, $postinfo); } // For the "Share This" plugin if (strpos($postinfo_string, '%share-this%') !== FALSE) { ob_start(); if (function_exists('sharethis_button')) { sharethis_button(); $share_this = ob_get_contents(); } else { $share_this = ""; } ob_end_clean(); $postinfo = str_replace("%share-this%", $share_this, $postinfo); } // Images if (strpos($postinfo_string, '<image(') !== FALSE) { $postinfo = preg_replace_callback("|<image\\((.*?)\\)>|", "bfa_image_files", $postinfo); } /* The meta = ALL custom fields:values, formatted by Wordpress as unordered list <ul><li>..</li><li>..</li></ul> */ if (strpos($postinfo_string, '%meta%') !== FALSE) { ob_start(); the_meta(); $the_meta = ob_get_contents(); ob_end_clean(); // 3.4.3.: remove bfa_ata metas */ $the_meta = preg_replace("/<li>(.*)bfa_ata(.*)<\\/li>/i", "", $the_meta); $postinfo = str_replace("%meta%", $the_meta, $postinfo); } // Single post meta values, not formatted if (strpos($postinfo_string, '%meta(') !== FALSE) { $postinfo = preg_replace_callback("|%meta\\('(.*?)'\\)%|", "bfa_meta_value", $postinfo); } // Since 3.6.7, parse widget areas $postinfo = bfa_parse_widget_areas($postinfo); return $postinfo; }
function add_postviews_column_content($column_name) { if ($column_name == 'views') { if (function_exists('the_views')) { the_views(true, '', '', true); } } }
?> " rel="bookmark" title="详细阅读 <?php the_title_attribute(); ?> "><?php the_title(); ?> </a></h2></div> <div class="infotop"> <span class="info-category-icon"><?php the_category(', '); ?> </span> <span class="info-view-icon">超过<?php if (function_exists(the_views)) { the_views(' 次', true); } ?> 围观</span> <span class="info-comment-icon"><?php comments_popup_link('0条评论', '1条评论', '%条评论'); ?> </span> </div> <div class="thumbnail_box"> <div class="thumbnail"> <a href="<?php the_permalink(); ?> " rel="bookmark" target="_blank" title="<?php the_title();