本文整理汇总了PHP中get_comment_pages_count函数的典型用法代码示例。如果您正苦于以下问题:PHP get_comment_pages_count函数的具体用法?PHP get_comment_pages_count怎么用?PHP get_comment_pages_count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_comment_pages_count函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: toivo_lite_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*
* @since 1.0.0
*/
function toivo_lite_comment_nav($class = '')
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="navigation comment-navigation <?php
echo esc_attr($class);
?>
" role="navigation">
<h2 class="screen-reader-text"><?php
_e('Comment navigation', 'toivo-lite');
?>
</h2>
<div class="nav-links">
<?php
if ($prev_link = get_previous_comments_link(__('← Older Comments', 'toivo-lite'))) {
printf('<div class="nav-previous">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link(__('Newer Comments →', 'toivo-lite'))) {
printf('<div class="nav-next">%s</div>', $next_link);
}
?>
</div><!-- .nav-links -->
</nav><!-- .comment-navigation -->
<?php
}
}
开发者ID:kimyj9501,项目名称:SingMyStory,代码行数:32,代码来源:template-tags.php
示例2: twentyfifteen_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*
*/
function twentyfifteen_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php
_e('Comment navigation', 'myblog');
?>
</h2>
<div class="nav-links">
<?php
if ($prev_link = get_previous_comments_link(__('Older Comments', 'myblog'))) {
printf('<div class="nav-previous">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link(__('Newer Comments', 'myblog'))) {
printf('<div class="nav-next">%s</div>', $next_link);
}
?>
</div>
<!-- .nav-links -->
</nav><!-- .comment-navigation -->
<?php
}
}
开发者ID:peymanslh,项目名称:MyBlog,代码行数:30,代码来源:template-tags.php
示例3: get_comment_nav
function get_comment_nav()
{
?>
<?php
if (get_comment_pages_count() > 1) {
?>
<div class="comments-nav">
<div class="prev">
<?php
previous_comments_link(__('Prev Comments', 'rb'));
?>
</div>
<div class="next">
<?php
next_comments_link(__('Next Comments', 'rb'));
?>
</div>
</div>
<?php
}
?>
<?php
}
开发者ID:anaved,项目名称:wordpress-tinkering,代码行数:25,代码来源:comments.php
示例4: tamatebako_comments_nav
/**
* Comments Nav
* @since 0.1.0
*/
function tamatebako_comments_nav()
{
if (get_option('page_comments') && 1 < get_comment_pages_count()) {
// Check for paged comments.
?>
<div class="comments-nav">
<?php
previous_comments_link('<span class="prev-comments"><span class="screen-reader-text">' . tamatebako_string('previous_comment') . '</span></span>');
?>
<span class="page-numbers"><?php
printf('%1$s / %2$s', get_query_var('cpage') ? absint(get_query_var('cpage')) : 1, get_comment_pages_count());
?>
</span>
<?php
next_comments_link('<span class="next-comments"><span class="screen-reader-text">' . tamatebako_string('next_comment') . '</span></span>');
?>
</div><!-- .comments-nav -->
<?php
}
// End check for paged comments.
}
开发者ID:WPDevHQ,项目名称:nevertheless,代码行数:31,代码来源:comment.php
示例5: paginate
/**
* Pagination based on options/args
*/
function paginate($args = false)
{
if ($this->type === 'comments' && !get_option('page_comments')) {
return;
}
$r = wp_parse_args($args, $this->options);
extract($r, EXTR_SKIP);
if (!isset($page) && !isset($pages)) {
global $wp_query;
if ($this->type === 'posts') {
$page = get_query_var('paged');
$posts_per_page = intval(get_query_var('posts_per_page'));
$pages = intval(ceil($wp_query->found_posts / $posts_per_page));
} else {
$page = get_query_var('cpage');
$comments_per_page = get_option('comments_per_page');
$pages = get_comment_pages_count();
}
$page = !empty($page) ? intval($page) : 1;
}
$prevlink = $this->type === 'posts' ? esc_url(get_pagenum_link($page - 1)) : get_comments_pagenum_link($page - 1);
$nextlink = $this->type === 'posts' ? esc_url(get_pagenum_link($page + 1)) : get_comments_pagenum_link($page + 1);
$output = stripslashes($before);
if ($pages > 1) {
$output .= sprintf('<ol class="wp-paginate%s">', $this->type === 'posts' ? '' : ' wp-paginate-comments');
if (strlen(stripslashes($title)) > 0) {
$output .= sprintf('<li><span class="title">%s</span></li>', stripslashes($title));
}
$ellipsis = "<li><span class='gap'>...</span></li>";
if ($page > 1 && !empty($previouspage)) {
$output .= sprintf('<li><a href="%s" class="prev">%s</a></li>', $prevlink, stripslashes($previouspage));
}
$min_links = $range * 2 + 1;
$block_min = min($page - $range, $pages - $min_links);
$block_high = max($page + $range, $min_links);
$left_gap = $block_min - $anchor - $gap > 0 ? true : false;
$right_gap = $block_high + $anchor + $gap < $pages ? true : false;
if ($left_gap && !$right_gap) {
$output .= sprintf('%s%s%s', $this->paginate_loop(1, $anchor), $ellipsis, $this->paginate_loop($block_min, $pages, $page));
} else {
if ($left_gap && $right_gap) {
$output .= sprintf('%s%s%s%s%s', $this->paginate_loop(1, $anchor), $ellipsis, $this->paginate_loop($block_min, $block_high, $page), $ellipsis, $this->paginate_loop($pages - $anchor + 1, $pages));
} else {
if ($right_gap && !$left_gap) {
$output .= sprintf('%s%s%s', $this->paginate_loop(1, $block_high, $page), $ellipsis, $this->paginate_loop($pages - $anchor + 1, $pages));
} else {
$output .= $this->paginate_loop(1, $pages, $page);
}
}
}
if ($page < $pages && !empty($nextpage)) {
$output .= sprintf('<li><a href="%s" class="next">%s</a></li>', $nextlink, stripslashes($nextpage));
}
$output .= "</ol>";
}
$output .= stripslashes($after);
if ($pages > 1 || $empty) {
echo $output;
}
}
开发者ID:bsboby,项目名称:Sample-code-frontend-dev,代码行数:63,代码来源:wp-paginate.php
示例6: thb_comments_navigation
function thb_comments_navigation()
{
global $post;
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
previous_comments_link(__('Older comments', 'thb_text_domain'));
next_comments_link(__('Newer comments', 'thb_text_domain'));
}
}
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:8,代码来源:helper.comments.php
示例7: getPagesCount
public static function getPagesCount($comments)
{
if (class_exists(InnThemeComment::class) && method_exists(InnThemeComment::class, 'getPagesCount')) {
return InnThemeComment::getPagesCount($comments);
}
static $count = null;
if ($count === null) {
$count = \get_comment_pages_count($comments, Other::getOption('comments_per_page'), Other::getOption('thread_comments'));
}
return $count;
}
开发者ID:kmvan,项目名称:poiauthor,代码行数:11,代码来源:Api.php
示例8: get_total_comment_pages
/**
* Retrieve the total number of comment pages.
*
* @return int $total Total number of comment pages.
*/
public function get_total_comment_pages()
{
global $wp_query;
// get max page from query
if (!empty($wp_query->max_num_comment_pages)) {
$max_page = $wp_query->max_num_comment_pages;
}
// if there is no max page in the query, calculate it
if (empty($max_page)) {
$max_page = get_comment_pages_count();
}
return intval(max($max_page, 1));
}
开发者ID:2createstudio,项目名称:carbon-pagination,代码行数:18,代码来源:Carbon_Pagination_Comments.php
示例9: comments_title
function comments_title()
{
global $wp_query;
$ppage = get_query_var('comments_per_page');
$num = get_comments_number();
// Subtract pings from this number
$num -= count($wp_query->comments_by_type['pings']);
if ($num > $ppage) {
echo sprintf(__('Comments (page %d of %d)', 'guangzhou'), get_query_var('cpage'), get_comment_pages_count());
} else {
if ($num > 0) {
echo sprintf(_n('%d Comment', '%d Comments', $num, 'guangzhou'), $num);
} else {
_e('No comments', 'guangzhou');
}
}
}
开发者ID:billerby,项目名称:Surdeg,代码行数:17,代码来源:comments.php
示例10: bootplate_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*/
function bootplate_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<ul class="pager comment-navigation" role="navigation">
<?php
if ($prev_link = get_previous_comments_link('Older Comments')) {
printf('<div class="pager-prev">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link('Newer Comments')) {
printf('<div class="pager-next">%s</div>', $next_link);
}
?>
</ul><!-- .comment-navigation -->
<?php
}
}
开发者ID:jdmdigital,项目名称:bootplate,代码行数:21,代码来源:template-tags.php
示例11: Radix_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*
* @since 1.0
*/
function Radix_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="comment-navigation" role="navigation">
<ul class="pager">
<?php
if ($prev_link = get_previous_comments_link(__('<i class="fa fa-chevron-left fa-fw" aria-hidden="true"></i> Older Comments', 'radix'))) {
printf('<li class="nav-previous previous">%s</li>', $prev_link);
}
if ($next_link = get_next_comments_link(__('Newer Comments <i class="fa fa-chevron-right fa-fw" aria-hidden="true"></i>', 'radix'))) {
printf('<li class="nav-next next">%s</li>', $next_link);
}
?>
</ul><!-- .nav-links -->
</nav><!-- end .navigation -->
<?php
}
}
开发者ID:liyanouou,项目名称:wordpress,代码行数:25,代码来源:template-tags.php
示例12: cleansimplewhite_comment_nav
function cleansimplewhite_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="navigation comment-navigation">
<div class="nav-links">
<?php
if ($prev_link = get_previous_comments_link(__('Older Comments', 'clean-simple-white'))) {
printf('<div class="nav-previous">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link(__('Newer Comments', 'clean-simple-white'))) {
printf('<div class="nav-next">%s</div>', $next_link);
}
?>
</div><!-- .nav-links -->
</nav><!-- .comment-navigation -->
<?php
}
}
开发者ID:pedroddf,项目名称:wordpress-bootstrap-theme,代码行数:20,代码来源:comments.php
示例13: puma_comment_nav
function puma_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="navigation comment-navigation u-textAlignCenter" role="navigation">
<div class="nav-links">
<?php
if ($prev_link = get_previous_comments_link('上一页')) {
printf('<div class="nav-previous">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link('下一页')) {
printf('<div class="nav-next">%s</div>', $next_link);
}
?>
</div>
</nav>
<?php
}
}
开发者ID:zhboner,项目名称:Modified-Puma,代码行数:20,代码来源:comment-action.php
示例14: scaffolder_comment_nav
/**
* Comments nav
*/
function scaffolder_comment_nav()
{
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php
_e('Comment navigation', 'scaffold');
?>
</h1>
<div class="nav-previous"><?php
previous_comments_link(__('← Older Comments', 'scaffold'));
?>
</div>
<div class="nav-next"><?php
next_comments_link(__('Newer Comments →', 'scaffold'));
?>
</div>
</nav>
<?php
}
}
开发者ID:360ecommerce,项目名称:scaffolder,代码行数:24,代码来源:helpers.php
示例15: the_bootstrap_comment_nav
/**
* Display navigation to next/previous comments pages when applicable
*
* @author Konstantin Obenland
* @since 1.5.0 - 19.05.2012
*
* @return void
*/
function the_bootstrap_comment_nav()
{
if (get_comment_pages_count() > 1 and get_option('page_comments')) {
// are there comments to navigate through
?>
<nav class="comment-nav well">
<h1 class="assistive-text"><?php
_e('Comment navigation', 'the-bootstrap');
?>
</h1>
<div class="nav-previous alignleft"><?php
next_comments_link(__('← Newer Comments', 'the-bootstrap'));
?>
</div>
<div class="nav-next alignright"><?php
previous_comments_link(__('Older Comments →', 'the-bootstrap'));
?>
</div>
</nav>
<?php
}
// check for comment navigation
}
开发者ID:jimmyshen007,项目名称:webproject,代码行数:31,代码来源:template-tags.php
示例16: fortunato_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*/
function fortunato_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<nav class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php
esc_html_e('Comment navigation', 'fortunato');
?>
</h2>
<div class="nav-links">
<?php
if ($prev_link = get_previous_comments_link('<i class="fa fa-lg fa-angle-double-left spaceRight"></i>' . esc_html__('Older Comments', 'fortunato'))) {
printf('<div class="nav-previous">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link(esc_html__('Newer Comments', 'fortunato') . '<i class="fa fa-lg fa-angle-double-right spaceLeft"></i>')) {
printf('<div class="nav-next">%s</div>', $next_link);
}
?>
</div><!-- .nav-links -->
</nav><!-- .comment-navigation -->
<?php
}
}
开发者ID:albertoquijano,项目名称:JesusGiles,代码行数:27,代码来源:template-tags.php
示例17: google_s_comment_nav
/**
* Display navigation to next/previous comments when applicable.
*
* @since Twenty Fifteen 1.0
*/
function google_s_comment_nav()
{
// Are there comments to navigate through?
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
?>
<div class="container-medium gs-mrg-top">
<p class="large"><?php
_e('Comment navigation', 'google_s');
?>
</p>
<nav class="article-nav gs-mrg-top" role="navigation">
<?php
if ($prev_link = get_previous_comments_link(__('Older Comments', 'google_s'))) {
printf('<div class="article-nav-link article-nav-link--prev">%s</div>', $prev_link);
}
if ($next_link = get_next_comments_link(__('Newer Comments', 'google_s'))) {
printf('<div class="article-nav-link article-nav-link--next">%s</div>', $next_link);
}
?>
</nav><!-- .comment-navigation -->
</div>
<?php
}
}
开发者ID:EugeneLiang,项目名称:google_s,代码行数:29,代码来源:template-tags.php
示例18: if
<?php if ( ! empty($comments_by_type['comment']) ) : ?>
<div id="comments-list" class="comments">
<h3><?php printf($comment_count > 1 ? __('<span>%d</span> Comments', 'uthili') : __('<span>One</span> Comment', 'uthili'), $comment_count) ?></h3>
<?php $total_pages = get_comment_pages_count(); if ( $total_pages > 1 ) : ?>
<div id="comments-nav-above" class="comments-navigation">
<div class="paginated-comments-links"><?php paginate_comments_links(); ?></div>
</div><!-- #comments-nav-above -->
<?php endif; ?>
<ol>
<?php wp_list_comments('type=comment&callback=custom_comments'); ?>
</ol>
<?php $total_pages = get_comment_pages_count(); if ( $total_pages > 1 ) : ?>
<div id="comments-nav-below" class="comments-navigation">
<div class="paginated-comments-links"><?php paginate_comments_links(); ?></div>
</div><!-- #comments-nav-below -->
<?php endif; ?>
</div><!-- #comments-list .comments -->
<?php endif; /* if ( $comment_count ) */ ?>
<?php if ( ! empty($comments_by_type['pings']) ) : ?>
<div id="trackbacks-list" class="comments">
<h3><?php printf($ping_count > 1 ? __('<span>%d</span> Trackbacks', 'uthili') : __('<span>One</span> Trackback', 'uthili'), $ping_count) ?></h3>
<ol>
开发者ID:noorul,项目名称:uthili,代码行数:31,代码来源:comments.php
示例19: graphene_comments_nav
/**
* Display comments pagination
*
* @package Graphene
* @since 1.9
*/
function graphene_comments_nav()
{
global $graphene_settings, $is_paginated;
if (get_comment_pages_count() > 1 && $is_paginated) {
?>
<div class="comment-nav clearfix">
<?php
if (function_exists('wp_commentnavi') && !$graphene_settings['inf_scroll_comments']) {
wp_commentnavi();
?>
<p class="commentnavi-view-all"><?php
wp_commentnavi_all_comments_link();
?>
</p>
<?php
} else {
?>
<p><?php
paginate_comments_links();
?>
</p>
<?php
}
do_action('graphene_comments_pagination');
?>
</div>
<?php
if ($graphene_settings['inf_scroll_comments']) {
?>
<p class="fetch-more-wrapper"><a href="#" class="fetch-more"><?php
_e('Fetch more comments', 'graphene');
?>
</a></p>
<?php
}
}
}
开发者ID:nanookYs,项目名称:orientreizen,代码行数:45,代码来源:theme-comments.php
示例20: comments_number
<?php
if (have_comments()) {
?>
<h3 id="comments-number" class="comments-header"><?php
comments_number(__('No Responses', 'my-life'), __('One Response', 'my-life'), __('% Responses', 'my-life'));
?>
</h3>
<?php
if (get_option('page_comments')) {
?>
<div class="comments-nav">
<span class="page-numbers"><?php
printf(__('Page %1$s of %2$s', 'my-life'), get_query_var('cpage') ? absint(get_query_var('cpage')) : 1, get_comment_pages_count());
?>
</span>
<?php
previous_comments_link();
?>
<?php
next_comments_link();
?>
</div><!-- .comments-nav -->
<?php
}
?>
<?php
do_atomic('before_comment_list');
开发者ID:panser,项目名称:wandromaha,代码行数:30,代码来源:comments.php
注:本文中的get_comment_pages_count函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论