本文整理汇总了PHP中comments_template函数的典型用法代码示例。如果您正苦于以下问题:PHP comments_template函数的具体用法?PHP comments_template怎么用?PHP comments_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comments_template函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_content
/**
* Template for fallback single post view (ie. when no Flow Template assigned, this loop template will be in use)
*
* @package ThemifyFlow
* @since 1.0.0
*/
function render_content()
{
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
get_template_part('includes/loop', 'single');
?>
<?php
wp_link_pages(array('before' => '<p><strong>' . __('Pages:', 'themify-flow') . ' </strong>', 'after' => '</p>', 'next_or_number' => 'number'));
?>
<?php
comments_template();
?>
<?php
}
}
?>
<?php
}
示例2: ultimatum_get_comments_template
function ultimatum_get_comments_template($instance=array()) {
global $post;
if ( ! post_type_supports( $post->post_type, 'comments' ) )
return;
if ( is_singular() && $instance['show_comments_form']=='true')
comments_template( '', true );
}
示例3: comments
function comments()
{
// If comments are open or we have at least one comment, load up the comment template.
if (comments_open() || get_comments_number()) {
comments_template();
}
}
示例4: render_shortcode
/**
* Render main shortcode.
*
* @since 1.0.0
* @access public
* @param array $atts
* @param string $content
* @return string
*/
public function render_shortcode($atts, $content = null)
{
$args = shortcode_atts(array('comments_per_page' => get_option('comments_per_page'), 'avatar_size' => 64), array_filter($atts), $this->shortcode);
if (TF_Model::is_template_page()) {
global $post;
$old_post = $post;
$post_with_comment = get_posts(array('posts_per_page' => 1, 'orderby' => 'comment_count', 'order' => 'DESC'));
if (!empty($post_with_comment)) {
$post = current($post_with_comment);
}
}
$this->comments_args = $args;
add_filter('wp_list_comments_args', array($this, 'wp_list_comments_args'));
add_filter('pre_option_comments_per_page', array($this, 'pre_option_comments_per_page'));
add_filter('pre_option_page_comments', array($this, 'pre_option_page_comments'));
ob_start();
?>
<?php
comments_template();
?>
<?php
$output = ob_get_clean();
remove_filter('wp_list_comments_args', array($this, 'wp_list_comments_args'));
remove_filter('pre_option_comments_per_page', array($this, 'pre_option_comments_per_page'));
remove_filter('pre_option_page_comments', array($this, 'pre_option_page_comments'));
if (isset($old_post)) {
wp_reset_postdata();
$post = $old_post;
}
return $output;
}
示例5: storefront_display_comments
/**
* Storefront display comments
* @since 1.0.0
*/
function storefront_display_comments()
{
// If comments are open or we have at least one comment, load up the comment template
if (comments_open() || '0' != get_comments_number()) {
comments_template();
}
}
示例6: vca_comments_template
function vca_comments_template()
{
// If comments are open or we have at least one comment, load up the comment template
if (CA_Option::get('enable_comments', true) && (comments_open() || '0' != get_comments_number())) {
comments_template();
}
}
示例7: pinnacle_page_comments
function pinnacle_page_comments()
{
global $pinnacle;
if (isset($pinnacle['page_comments']) && $pinnacle['page_comments'] == 1) {
comments_template('/templates/comments.php');
}
}
示例8: render_content
function render_content()
{
if (have_posts()) {
?>
<div class="loop">
<div class="loop-content">
<?php
while (have_posts()) {
// The Loop
the_post();
do_action('epl_property_single');
comments_template();
// include comments template
}
// end of one post
?>
</div>
</div>
<?php
} else {
// do not delete
do_action('builder_template_show_not_found');
}
// do not delete
}
示例9: tc_comments
/**
* Main commments template
*
* @package Customizr
* @since Customizr 3.0.10
*/
function tc_comments()
{
if (!$this->tc_are_comments_enabled()) {
return;
}
comments_template('', true);
}
示例10: siteorigin_ajax_comments_ajax_comment_rerender
/**
* Render all the ajax comments
*/
function siteorigin_ajax_comments_ajax_comment_rerender($location, $comment)
{
if (empty($_POST['is_ajax'])) {
return $location;
}
$post_id = isset($_POST['comment_post_ID']) ? intval($_POST['comment_post_ID']) : '';
// We're going to pretend this is a single
$query = array('post_id' => $post_id);
if (get_option('page_comments')) {
$args['per_page'] = get_option('comments_per_page');
$cpage = get_page_of_comment($comment->comment_ID, $args);
$query['cpage'] = $cpage;
}
// Prevents a conflict with older versions of Page Builder.
remove_filter('the_posts', 'siteorigin_panels_prepare_post_content');
query_posts($query);
global $wp_query;
$wp_query->is_single = true;
$wp_query->is_singular = true;
ob_start();
comments_template();
$comment_html = ob_get_clean();
wp_reset_query();
echo json_encode(array('status' => 'success', 'html' => $comment_html));
exit;
}
示例11: rt_get_commnets_template
/**
* get commnets template shortcode
*
* retrives post comments as a string
*
* @param array $atts
* @param string $content
* @return string comments
*/
function rt_get_commnets_template($atts, $content = null)
{
ob_start();
comments_template();
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
}
开发者ID:ryan-konkolewski,项目名称:rt-theme-19-extentions-multisite,代码行数:17,代码来源:rt_get_commnets_template.php
示例12: genesis_get_comments_template
/**
* Output the comments at the end of posts / pages.
*
* Load comments only if we are on a page or post and only if comments or
* trackbacks are enabled.
*
* @since 1.1.0
*
* @uses genesis_get_option()
*/
function genesis_get_comments_template()
{
if (is_single() && (genesis_get_option('trackbacks_posts') || genesis_get_option('comments_posts'))) {
comments_template('', true);
} elseif (is_page() && (genesis_get_option('trackbacks_pages') || genesis_get_option('comments_pages'))) {
comments_template('', true);
}
}
示例13: thb_comments
function thb_comments($form_args = array())
{
comments_template('', true);
$form_args += array('title_reply' => __('Reply', 'thb_text_domain'));
if (comments_open()) {
comment_form($form_args);
}
}
示例14: beans_comments_template
/**
* Echo comments template part.
*
* The comments template part only loads if comments are active to prevent unnecessary memory usage.
*
* @since 1.0.0
*/
function beans_comments_template()
{
global $post;
if (!post_type_supports(beans_get('post_type', $post), 'comments')) {
return;
}
comments_template();
}
示例15: section_template
function section_template() {
// Important! Comments.php must be in theme root to work properly. Also 'comments_template() function must be used. Its a wordpress thing.
global $post;
comments_template();
}