当前位置: 首页>>代码示例>>PHP>>正文


PHP get_next_comments_link函数代码示例

本文整理汇总了PHP中get_next_comments_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_next_comments_link函数的具体用法?PHP get_next_comments_link怎么用?PHP get_next_comments_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_next_comments_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: ultimatum_do_comments

function ultimatum_do_comments() {
	global $post, $wp_query;
	if ( ! post_type_supports( $post->post_type, 'comments' ) )
		return;
	if ( have_comments() && ! empty( $wp_query->comments_by_type['comment'] ) ) {
		echo '<div id="comments" class="entry-comments">';
			echo apply_filters( 'ultimatum_title_comments', __( '<h3>Comments</h3>', 'ultimatum' ) );
			echo '<ol class="comment-list">';
				do_action( 'ultimatum_list_comments' );
			echo '</ol>';

			//* Comment Navigation
			$prev_link = get_previous_comments_link( apply_filters( 'ultimatum_prev_comments_link_text', '' ) );
			$next_link = get_next_comments_link( apply_filters( 'ultimatum_next_comments_link_text', '' ) );

			if ( $prev_link || $next_link )
				printf( '<div class="navigation"><div class="alignleft">%s</div><div class="alignright">%s</div></div>', $prev_link, $next_link );
		echo '</div>';
	}
	elseif ( 'open' == $post->comment_status && $no_comments_text = apply_filters( 'ultimatum_no_comments_text', '' ) ) {
		echo '<div id="comments">' . $no_comments_text . '</div>';
	}
	elseif ( $comments_closed_text = apply_filters( 'ultimatum_comments_closed_text', '' ) ) {
		echo '<div id="comments">' . $comments_closed_text . '</div>';
	}

}
开发者ID:polaris610,项目名称:medicalhound,代码行数:27,代码来源:comments.php

示例3: 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(__('&larr; Older Comments', 'toivo-lite'))) {
                printf('<div class="nav-previous">%s</div>', $prev_link);
            }
            if ($next_link = get_next_comments_link(__('Newer Comments &rarr;', '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

示例4: test_page_should_default_to_1_when_no_cpage_query_var_is_found

 /**
  * @ticket 20319
  */
 public function test_page_should_default_to_1_when_no_cpage_query_var_is_found()
 {
     $p = self::factory()->post->create();
     $this->go_to(get_permalink($p));
     $cpage = get_query_var('cpage');
     set_query_var('cpage', '');
     $link = get_next_comments_link('Next', 5);
     $this->assertContains('cpage=2', $link);
     set_query_var('cpage', $cpage);
 }
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:13,代码来源:getNextCommentsLink.php

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: genesis_do_comments

/**
 * Echo Genesis default comment structure.
 *
 * Does the `genesis_list_comments` action.
 *
 * Applies the `genesis_title_comments`, `genesis_prev_comments_link_text`, `genesis_next_comments_link_text`, and
 * `genesis_comments_closed_text` filters.
 *
 * @since 1.1.2
 *
 * @uses genesis_get_option() Get theme setting value.
 *
 * @global WP_Query $wp_query Query object.
 *
 * @return null Return early if on a page with Genesis pages comments off, or on a post with Genesis posts comments off.
 */
function genesis_do_comments()
{
    global $wp_query;
    //* Bail if comments are off for this post type
    if (is_page() && !genesis_get_option('comments_pages') || is_single() && !genesis_get_option('comments_posts')) {
        return;
    }
    if (have_comments() && !empty($wp_query->comments_by_type['comment'])) {
        genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div id="comments">', 'context' => 'entry-comments'));
        echo apply_filters('genesis_title_comments', __('<h3>Comments</h3>', 'genesis'));
        printf('<ol %s>', genesis_attr('comment-list'));
        do_action('genesis_list_comments');
        echo '</ol>';
        //* Comment Navigation
        $prev_link = get_previous_comments_link(apply_filters('genesis_prev_comments_link_text', ''));
        $next_link = get_next_comments_link(apply_filters('genesis_next_comments_link_text', ''));
        if ($prev_link || $next_link) {
            genesis_markup(array('html5' => '<div %s>', 'xhtml' => '<div class="navigation">', 'context' => 'comments-pagination'));
            printf('<div class="pagination-previous alignleft">%s</div>', $prev_link);
            printf('<div class="pagination-next alignright">%s</div>', $next_link);
            echo '</div>';
        }
        echo '</div>';
    } elseif ('open' === get_post()->comment_status && ($no_comments_text = apply_filters('genesis_no_comments_text', ''))) {
        if (genesis_html5()) {
            echo sprintf('<div %s>', genesis_attr('entry-comments')) . $no_comments_text . '</div>';
        } else {
            echo '<div id="comments">' . $no_comments_text . '</div>';
        }
    } elseif ($comments_closed_text = apply_filters('genesis_comments_closed_text', '')) {
        if (genesis_html5()) {
            echo sprintf('<div %s>', genesis_attr('entry-comments')) . $comments_closed_text . '</div>';
        } else {
            echo '<div id="comments">' . $comments_closed_text . '</div>';
        }
    }
}
开发者ID:Friends-School-Atlanta,项目名称:Deployable-WordPress,代码行数:53,代码来源:comments.php

示例10: 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

示例11: 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

示例12: thesis_comments_navigation

function thesis_comments_navigation($position = 1)
{
    if (get_option('page_comments')) {
        // Output navigation only if comment pagination is enabled.
        global $wp_query;
        $total_pages = get_comment_pages_count();
        $current_page = $wp_query->query_vars['cpage'];
        if ($total_pages > 1) {
            $nav = "\t\t\t\t<div id=\"comment_nav_{$position}\" class=\"prev_next\">\n";
            if ($current_page == $total_pages) {
                $nav .= "\t\t\t\t\t<p class=\"previous\">";
                $nav .= get_previous_comments_link('&larr; ' . __('Previous Comments', 'thesis'));
                $nav .= "</p>\n";
            } elseif ($current_page == 1) {
                $nav .= "\t\t\t\t\t<p class=\"next\">";
                $nav .= get_next_comments_link(__('Next Comments', 'thesis') . ' &rarr;');
                $nav .= "</p>\n";
            } elseif ($current_page < $total_pages) {
                $nav .= "\t\t\t\t\t<p class=\"previous floated\">";
                $nav .= get_previous_comments_link('&larr; ' . __('Previous Comments', 'thesis'));
                $nav .= "</p>\n";
                $nav .= "\t\t\t\t\t<p class=\"next\">";
                $nav .= get_next_comments_link(__('Next Comments', 'thesis') . ' &rarr;');
                $nav .= "</p>\n";
            }
            $nav .= "\t\t\t\t</div>\n\n";
            echo apply_filters('thesis_comments_navigation', $nav, $position);
            #filter
        }
    }
}
开发者ID:CherylMuniz,项目名称:fashion,代码行数:31,代码来源:comments.php

示例13: get_next_comments_link

 /**
  * @param array $args
  *
  * @return string
  */
 function get_next_comments_link($args = array())
 {
     $args = wp_parse_args($args, array('format' => '<div class="nav-next">%link</div>', 'link_text' => esc_html__('Newer Comments', 'wplib'), 'max_page' => 0));
     $link = get_next_comments_link($args['label'], $args['max_page']);
     return $link ? str_replace('%link', $link, $args['format']) : '';
 }
开发者ID:wpscholar,项目名称:wplib,代码行数:11,代码来源:class-post-view-base.php

示例14: HuI_comment_nav

function HuI_comment_nav()
{
    // Are there comments to navigate through?
    if (get_comment_pages_count() > 1 && get_option('page_comments')) {
        ?>
    <nav class="navigation comment-navigation text-center clearfix" role="navigation">
        <div class="nav-links">
            <?php 
        if ($prev_link = get_previous_comments_link('上一页')) {
            printf('<div class="nav-previous pull-left">%s</div>', $prev_link);
        }
        if ($next_link = get_next_comments_link('下一页')) {
            printf('<div class="nav-next pull-right">%s</div>', $next_link);
        }
        ?>
        </div><!-- .nav-links -->
    </nav><!-- .comment-navigation -->
    <?php 
    }
}
开发者ID:happyet,项目名称:WaterFlow,代码行数:20,代码来源:functions.php

示例15: die

 * Additional settings are available under the Appearance -> Theme Options -> Comments.
 *
 */
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
    die('Please do not load this page directly. Thanks!');
}
if (post_password_required()) {
    theme_post_wrapper(array('content' => '<p class="nocomments">' . __('This post is password protected. Enter the password to view any comments.', THEME_NS) . '</p>'));
    return;
}
if (have_comments()) {
    theme_ob_start();
    printf(_n('One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), THEME_NS), number_format_i18n(get_comments_number()), '<em>' . get_the_title() . '</em>');
    theme_post_wrapper(array('content' => '<h4 id="comments">' . theme_ob_get_clean() . '</h4>'));
    $prev_link = get_previous_comments_link(__('<span class="meta-nav">&larr;</span> Older Comments', THEME_NS));
    $next_link = get_next_comments_link(__('Newer Comments <span class="meta-nav">&rarr;</span>', THEME_NS));
    theme_page_navigation(array('prev_link' => $prev_link, 'next_link' => $next_link));
    echo '<ul id="comments-list">';
    wp_list_comments('type=all&callback=theme_comment');
    echo '</ul>';
    theme_page_navigation(array('prev_link' => $prev_link, 'next_link' => $next_link));
}
theme_ob_start();
$args = array();
if (theme_get_option('theme_comment_use_smilies')) {
    function theme_comment_form_field_comment($form_field)
    {
        theme_include_lib('smiley.php');
        return theme_get_smilies_js() . '<p class="smilies">' . theme_get_smilies() . '</p>' . $form_field;
    }
    add_filter('comment_form_field_comment', 'theme_comment_form_field_comment');
开发者ID:slavam,项目名称:adult-childhood,代码行数:31,代码来源:comments.php


注:本文中的get_next_comments_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。