本文整理汇总了PHP中the_views函数的典型用法代码示例。如果您正苦于以下问题:PHP the_views函数的具体用法?PHP the_views怎么用?PHP the_views使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_views函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_views
function custom_views()
{
$lect = "";
if (function_exists('the_views')) {
if (the_views() != "") {
$lect = the_views(false);
}
}
return $lect;
}
示例2: widget
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
}
示例3: makeThumb
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>';
}
示例4: the_bootstrap_posted_on
/**
* 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>');
}
示例5: the_content
// Обратите внимание: Мы не будет открывать 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)) { ?>
示例6: get_views
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;
}
示例7: the_permalink
<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>
示例8: widget
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">
//.........这里部分代码省略.........
示例9: the_author_posts_link
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'));
示例10: get_header
* @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">
示例11: the_title
" ><?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
}
示例12: mb_strimwidth
?>
<?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
}
示例13: rbn_dom
/**
* 生成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
}
?>
//.........这里部分代码省略.........
示例14: mutheme_views
/**
* 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
}
}
示例15: get_film_home
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;
}