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


PHP have_comments函数代码示例

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


在下文中一共展示了have_comments函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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">&nbsp;</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 "&#8734;" 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()) . '">&#8734;</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 &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', 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


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