本文整理汇总了PHP中have_comments函数的典型用法代码示例。如果您正苦于以下问题:PHP have_comments函数的具体用法?PHP have_comments怎么用?PHP have_comments使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了have_comments函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: restful_post_meta_above
/**
* Post meta for above the post.
*/
function restful_post_meta_above()
{
global $post;
?>
<div class="entry__meta-item">
<i class="fa fa-calendar"></i>
<a href="<?php
esc_url(get_permalink());
?>
"><?php
the_time(get_option('date_format'));
?>
</a>
</div>
<div class="entry__meta-item">
<i class="fa fa-user"></i>
<a href="<?php
echo esc_url(get_author_posts_url($post->post_author));
?>
"><?php
the_author_meta('display_name', $post->post_author);
?>
</a>
</div>
<?php
if (comments_open() || have_comments()) {
?>
<div class="entry__meta-item">
<i class="fa fa-comment"></i>
<a href="<?php
esc_url(comments_link());
?>
"><?php
comments_number();
?>
</a>
</div>
<?php
}
?>
<?php
}
开发者ID:themebright,项目名称:Restful,代码行数:49,代码来源:template-tags.php
示例2: comments_evolved_template
function comments_evolved_template($file)
{
global $post, $comments;
if (!(is_singular() && (have_comments() || 'open' == $post->comment_status))) {
return;
}
return COMMENTS_EVOLVED_TEMPLATES . '/container.php';
}
开发者ID:ruo91,项目名称:comments-evolved,代码行数:8,代码来源:frontend.php
示例3: getCommentsTemplate
public function getCommentsTemplate($default_template)
{
global $wpdb, $post;
if (!(is_singular() && (have_comments() || 'open' == $post->comment_status))) {
return $default_template;
}
return dirname(__FILE__) . '/comments_sohu.php';
}
开发者ID:ijustyce,项目名称:zblogphp,代码行数:8,代码来源:Handler.php
示例4: tabs_shortcode
function tabs_shortcode($atts, $content = null)
{
if (comments_open() || have_comments()) {
return '<div class="responsive-tabs content-tabs">' . do_shortcode($content) . '</div>';
} else {
return '<div class="responsive-tabs content-tabs">' . do_shortcode($content) . '</div><script>jQuery(document).ready(function() { RESPONSIVEUI.responsiveTabs(); }) </script>';
}
}
开发者ID:ramsaut,项目名称:urwahl3000,代码行数:8,代码来源:theme-shortcodes.php
示例5: bpmagic_allow_comments_on_posts
/**
* Whether to allow comments on posts or not
*
* @global object $post
* @return boolean
*/
function bpmagic_allow_comments_on_posts()
{
global $post;
$show = 0;
if ('open' == $post->comment_status || have_comments()) {
$show = 1;
}
return apply_filters('bpmag_allow_comments_on_posts', $show);
//true by default
}
开发者ID:buddydev,项目名称:bp-magic,代码行数:16,代码来源:post-ext.php
示例6: psp_comment_template
function psp_comment_template($comment_template)
{
global $post;
if (!(is_singular() && (have_comments() || 'open' == $post->comment_status))) {
return;
}
if ($post->post_type == 'psp_projects') {
// assuming there is a post type called business
return dirname(__FILE__) . '/templates/comments.php';
}
}
开发者ID:Ingenex,项目名称:redesign,代码行数:11,代码来源:custom_comments.php
示例7: theme_comments_render_list
function theme_comments_render_list($callback)
{
?>
<?php
if (have_comments()) {
?>
<div class="cl"> </div>
<h3><?php
comments_number('Keine Antworten', 'Eine Antwort', '% Antworten');
?>
</h3>
<ol class="all-comments">
<?php
wp_list_comments('callback=' . $callback);
?>
</ol>
<?php
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
// Are there comments to navigate through?
?>
<div class="navigation">
<div class="alignleft"><?php
previous_comments_link();
?>
</div>
<div class="alignright"><?php
next_comments_link();
?>
</div>
</div>
<?php
}
?>
<?php
} else {
?>
<?php
if (comments_open()) {
?>
<!-- If comments are open, but there are no comments. -->
<?php
} else {
// comments are closed
?>
<p class="nocomments">Kommentare sind geschlossen.</p>
<?php
}
?>
<?php
}
?>
<?php
}
开发者ID:alekseyLymarev,项目名称:wordpress.cubetechOldTheme,代码行数:54,代码来源:comments.php
示例8: tamatebako_post_format_aside_infinity
/**
* Adds an infinity character "∞" to the end of the post content on 'aside' posts.
*/
function tamatebako_post_format_aside_infinity($content)
{
if (has_post_format('aside') && !is_singular() && !post_password_required()) {
$infinity = '<a class="permalink" href="' . esc_url(get_permalink()) . '">∞</a>';
if (have_comments() || comments_open()) {
$infinity = '<a class="comments-link" href="' . esc_url(get_permalink()) . '">' . number_format_i18n(get_comments_number()) . '</a>';
}
$content .= ' ' . $infinity;
}
return $content;
}
开发者ID:WPDevHQ,项目名称:nevertheless,代码行数:14,代码来源:post-formats.php
示例9: ultimatum_do_pings
function ultimatum_do_pings() {
global $post, $wp_query;
if ( ! post_type_supports( $post->post_type, 'trackbacks' ) )
return;
if ( have_comments() && !empty( $wp_query->comments_by_type['pings'] ) ) {
?>
<div id="pings">
<?php echo apply_filters( 'ultimatum_title_pings', __( '<h3>Trackbacks</h3>', 'ultimatum' ) ); ?>
<ol class="ping-list">
<?php do_action( 'ultimatum_list_pings' ); ?>
</ol>
</div>
<?php
}
else {
echo apply_filters( 'ultimatum_no_pings_text', '' );
}
}
开发者ID:polaris610,项目名称:medicalhound,代码行数:19,代码来源:comments.php
示例10: wptouch_the_post
<?php
if (wptouch_have_posts()) {
?>
<?php
wptouch_the_post();
?>
<?php
get_template_part('page-content');
?>
<?php
}
?>
</div> <!-- content -->
<?php
if (wptouch_fdn_show_comments_on_pages() && (comments_open() || have_comments())) {
?>
<div id="comments">
<?php
comments_template();
?>
</div>
<?php
}
?>
<?php
get_footer();
?>
<?php
开发者ID:liangwei1988,项目名称:wordpress,代码行数:31,代码来源:page.php
示例11: esc_attr
data-width="<?php
echo esc_attr($WPFBC->get_width());
?>
"></div>
</div>
<?php
do_action('fb_after_fb_comments');
?>
<?php
do_action('fb_before_old_comments');
?>
<?php
if ($WPFBC->setting('show_old_comments', 'on') == 'on' && have_comments()) {
?>
<div class="navigation">
<div class="alignleft"><?php
previous_comments_link();
?>
</div>
<div class="alignright"><?php
next_comments_link();
?>
</div>
</div>
<?php
if (has_filter('fb_comments_template')) {
?>
开发者ID:kevinreilly,项目名称:ivsn-wp,代码行数:31,代码来源:comments.php
示例12: cfct_banner
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
die;
}
if (CFCT_DEBUG) {
cfct_banner(__FILE__);
}
global $post, $wp_query, $comments, $comment;
if (have_comments() || 'open' == $post->comment_status) {
if (empty($post->post_password) || $_COOKIE['wp-postpass_' . COOKIEHASH] == $post->post_password) {
$comments = $wp_query->comments;
$comment_count = count($comments);
$comment_count == 1 ? $comment_title = __('One Response', 'carrington-blog') : ($comment_title = sprintf(__('%d Responses', 'carrington-blog'), $comment_count));
}
?>
<div class="rule-major"><hr /></div>
<h2 class="h1 comments-title"><?php
echo $comment_title;
?>
</h2>
<p><?php
开发者ID:rascoop,项目名称:carrington,代码行数:31,代码来源:comments-default.php
示例13: get_comments
<?php
$total_count = get_comments(array('post_id' => $post->ID, 'type' => 'comment', 'count' => true, 'status' => 'approve'));
$comments = get_comments(array('type' => 'comment', 'post_id' => $post->ID, 'status' => 'approve'));
?>
<div id="comments" class="project-comments comments-area et-comments-area">
<?php
if (have_comments() && $total_count > 0) {
?>
<h3 class="title et-comments-title">
<?php
if ($total_count == 0) {
_e("0 Comments", 'comment-project');
} else {
if ($total_count == 1) {
printf(__("%d Comment", 'comment-project'), intval($total_count));
} else {
printf(__('%d Comments', 'comment-project'), $total_count);
}
}
?>
</h3>
<ol class="comment-list">
<?php
wp_list_comments(array('style' => 'ul', 'short_ping' => true, 'callback' => 'fre_project_comment_callback'), $comments);
?>
</ol><!-- .comment-list -->
<?php
开发者ID:linniepinski,项目名称:perssistant,代码行数:31,代码来源:comment-project.php
示例14: thb_show_comments
function thb_show_comments($post_type = null)
{
global $post;
$comments_enabled = true;
// $custom_post_types = get_post_types( array('public' => true, '_builtin' => false) );
// if( !$post_type ) {
// $post_type = $post->post_type;
// }
// if( in_array($post_type, $custom_post_types) ) {
// $comments_enabled = thb_get_option($post_type . '_comments') == '1';
// }
return $comments_enabled && (have_comments() || comments_open());
}
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:13,代码来源:helper.comments.php
示例15: printf
* return early without loading the comments.
*/
if (post_password_required()) {
return;
}
?>
<hr />
<div class="row">
<div id="comments" class="comments-area">
<?php
// You can start editing here -- including this comment!
?>
<?php
if (have_comments()) {
?>
<h2 class="comments-title columns large-12">
<?php
printf(_nx('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'sennzaversion3'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>');
?>
</h2>
<?php
if (get_comment_pages_count() > 1 && get_option('page_comments')) {
// are there comments to navigate through
?>
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
<h1 class="screen-reader-text"><?php
_e('Comment navigation', 'sennzaversion3');
?>
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:comments.php
示例16: get_option
<?php
$req = get_option('require_name_email'); // Checks if fields are required.
if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
die ( 'Please do not load this page directly. Thanks!' );
if ( ! empty($post->post_password) ) :
if ( $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password ) :
?>
<div class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'uthili') ?></div>
</div><!-- .comments -->
<?php
return;
endif;
endif;
?>
<?php if ( have_comments() ) : ?>
<?php /* numbers of pings and comments */
$ping_count = $comment_count = 0;
foreach ( $comments as $comment )
get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;
?>
<?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>
开发者ID:noorul,项目名称:uthili,代码行数:31,代码来源:comments.php
示例17: dsq_comments_template
function dsq_comments_template($value)
{
global $EMBED;
global $post;
global $comments;
if (!(is_singular() && (have_comments() || 'open' == $post->comment_status))) {
return;
}
if (!dsq_is_installed() || !dsq_can_replace()) {
return $value;
}
// TODO: If a disqus-comments.php is found in the current template's
// path, use that instead of the default bundled comments.php
//return TEMPLATEPATH . '/disqus-comments.php';
$EMBED = true;
if (dcl_check_shortcode('js-disqus') || 'open' !== $post->comment_status) {
return dirname(__FILE__) . '/../public/dcl-empty.php';
} else {
return dirname(__FILE__) . '/../public/dcl-comments.php';
}
}
开发者ID:VizualAbstract,项目名称:Marilyn,代码行数:21,代码来源:disqus.php
示例18: the_bootstrap_comments_list
/**
* Displays comment list, when there are any
*
* @author Konstantin Obenland
* @since 1.7.0 - 16.06.2012
*
* @return void
*/
function the_bootstrap_comments_list()
{
if (post_password_required()) {
?>
<div id="comments">
<p class="nopassword"><?php
_e('This post is password protected. Enter the password to view any comments.', 'the-bootstrap');
?>
</p>
</div><!-- #comments -->
<?php
return;
}
if (have_comments()) {
?>
<div id="comments">
<h2 id="comments-title">
<?php
printf(_n('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'the-bootstrap'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>');
?>
</h2>
<?php
the_bootstrap_comment_nav();
?>
<ol class="commentlist unstyled">
<?php
wp_list_comments(array('callback' => 'the_bootstrap_comment'));
?>
</ol><!-- .commentlist .unstyled -->
<?php
the_bootstrap_comment_nav();
?>
</div><!-- #comments -->
<?php
}
}
开发者ID:pedrokoblitz,项目名称:wp-insolito-theme,代码行数:48,代码来源:functions.php
示例19: next_comments_link
<p class="next-comment"><?php
next_comments_link();
?>
</p>
</nav>
<?php
}
?>
<p class="comments-closed pings-open">
<?php
printf(__('Comments are closed, but <a href="%s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'founder'), esc_url(get_trackback_url()));
?>
</p>
</section>
<?php
} elseif (!comments_open() && have_comments()) {
?>
<section id="comments" class="comments">
<div class="comments-number">
<h3>
<?php
comments_number(__('Comments', 'founder'), __('One Comment', 'founder'), __('% Comments', 'founder'));
?>
</h3>
</div>
<ol class="comment-list">
<?php
wp_list_comments(array('callback' => 'ct_founder_customize_comments', 'max_depth' => '3'));
?>
</ol>
<?php
开发者ID:jgypsygrrl,项目名称:wordpress-REST-API-test,代码行数:31,代码来源:comments.php
示例20: genesis_do_pings
function genesis_do_pings()
{
global $post, $wp_query;
// Check
if (is_page() && !genesis_get_option('trackbacks_pages') || is_single() && !genesis_get_option('trackbacks_posts')) {
return;
}
if (have_comments() && !empty($wp_query->comments_by_type['pings'])) {
// if have pings
?>
<div id="pings">
<?php
echo apply_filters('genesis_title_pings', __('<h3>Trackbacks</h3>', 'genesis'));
?>
<ol class="ping-list">
<?php
genesis_list_pings();
?>
</ol>
</div><!-- end #pings -->
<?php
} else {
// this is displayed if there are no pings
?>
<?php
echo apply_filters('genesis_no_pings_text', '');
?>
<?php
}
// endif have pings
?>
<?php
}
开发者ID:Weissenberger13,项目名称:web.portugalrentalcottages,代码行数:39,代码来源:comments.php
注:本文中的have_comments函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论