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);
     }
 }
Beispiel #2
0
/**
 * 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 
}
Beispiel #3
0
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 );
}
Beispiel #4
0
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();
    }
}
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();
    }
}
/**
 * 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;
}
function pinnacle_page_comments()
{
    global $pinnacle;
    if (isset($pinnacle['page_comments']) && $pinnacle['page_comments'] == 1) {
        comments_template('/templates/comments.php');
    }
}
 /**
  * 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();
     }
 }
 /**
  * Main commments template
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_comments()
 {
     if (!$this->tc_are_comments_enabled()) {
         return;
     }
     comments_template('', true);
 }
Beispiel #10
0
    /**
     * 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;
    }
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
}
 /**
  * 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;
 }
	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();
		
	}
Beispiel #14
0
/**
 * 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);
    }
}
Beispiel #15
0
/**
 * 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();
}
 /**
  * Main commments template
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_comments()
 {
     //By default not displayed on home, for protected posts, and if no comments for page option is checked
     $comments_bool = post_password_required() || tc__f('__is_home') || is_page() && 1 != esc_attr(tc__f('__get_option', 'tc_page_comments')) ? false : true;
     if (!apply_filters('tc_show_comments', $comments_bool)) {
         return;
     }
     comments_template('', true);
 }
 /**
  * Main commments template
  *
  * @package Customizr
  * @since Customizr 3.0.10
  */
 function tc_comments()
 {
     if (!$this->tc_are_comments_enabled()) {
         return;
     }
     do_action('tc_before_comments_template');
     comments_template('', true);
     do_action('tc_after_comments_template');
 }
function pweb_gbook()
{
    global $post;
    ob_start();
    comments_template('/functions/gbook.php');
    $gbook = ob_get_clean();
    //Get the buffer and erase it
    return $gbook;
}
Beispiel #19
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     ob_start();
     //start buffering the output instead of echoing it
     comments_template('/includes/comments.php');
     //wordpress function that loads the comments template "comments.php"
     $output = ob_get_clean();
     return $output;
 }
Beispiel #20
0
function cfct_ajax_post_comments($post_id)
{
    global $post, $wp_query;
    $wp_query->is_single = true;
    $posts = get_posts('include=' . $post_id);
    $post = $posts[0];
    setup_postdata($post);
    comments_template();
}
/**
 * Prints HTML with article's footer. 
 * 
 */
function lady_B_post_footer($show_comments_template = false, $show_no_comment_info = true)
{
    //check comments
    $num_comments = get_comments_number();
    // get_comments_number returns only a numeric value
    if (comments_open()) {
        if ($num_comments == 0) {
            $comments = __('No comments', 'lady_B');
        } elseif ($num_comments > 1) {
            $comments = $num_comments . __(' comments', 'lady_B');
        } else {
            $comments = __('1 comment', 'lady_B');
        }
        $comments_txt = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
    } else {
        if ($show_no_comment_info) {
            $comments_txt = __('Comments are off for this post.', 'lady_B');
        } else {
            $comments_txt = '';
        }
    }
    //check tags
    $separator = ', ';
    $posttags = get_the_tags();
    $mtags = "";
    if ($posttags) {
        $mtags = __('Tags: ', 'lady_B');
        foreach ($posttags as $tag) {
            $mtags .= '<a href="' . esc_url(get_tag_link($tag->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts tagged %s', 'lady_B'), $tag->name)) . '">' . esc_html($tag->name) . '</a>' . $separator;
        }
        $mtags .= "<br/>";
    }
    //check categories
    $mcat = "";
    $postcat = get_the_category();
    if ($postcat) {
        $mcat = __('In: ', 'lady_B');
        foreach ($postcat as $category) {
            $mcat .= '<a href="' . esc_url(get_category_link($category->term_id)) . '" alt="' . esc_attr(sprintf(__('View all posts in %s', 'lady_B'), $category->name)) . '">' . esc_html($category->name) . '</a>' . $separator;
        }
    }
    //we need different layout for single.php
    if ($show_comments_template) {
        $template = "";
        if (comments_open() || get_comments_number()) {
            ob_start();
            comments_template();
            $template = ob_get_contents();
            // Store buffer in variable
            ob_end_clean();
        }
        print "</div><!--end of entry--><footer><p class='more'>" . $mtags . $mcat . "</p><p class='comments'>" . $comments_txt . "</p>" . $template . "</footer></article><!--end of post-->";
    } else {
        print "</div><!--end of entry--><footer><p class='comments'>" . $comments_txt . "</p><p class='more'>" . $mtags . $mcat . "</p></footer></article><!--end of post-->";
    }
}
Beispiel #22
0
 /**
  * Actions display comments
  * @since  1.0.0
  */
 function actions_display_comments()
 {
     if (post_password_required()) {
         return;
     }
     // 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();
     }
 }
/**
 * Output the comments at the end of posts/pages.
 * The checks are for 3rd party comment systems.
 *
 * @since 1.1
 * @uses genesis_get_option()
 */
function genesis_get_comments_template()
{
    // Load comments only if we are on a page or post and only if comments or trackbacks are chosen
    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);
    }
    return;
}
Beispiel #24
0
 function st_rental_review()
 {
     if (is_singular('st_rental')) {
         if (comments_open() and st()->get_option('rental_review') == 'on') {
             ob_start();
             comments_template('/reviews/reviews.php');
             return @ob_get_clean();
         }
     }
 }
Beispiel #25
0
function render_content()
{
    ?>
	<?php 
    if (have_posts()) {
        ?>
		<div class="loop">
			<div class="loop-content">
				<?php 
        while (have_posts()) {
            // The Loop
            ?>
					<?php 
            the_post();
            ?>
						<?php 
            get_template_part('post-formats/content-single', get_post_format());
            ?>
						<!-- end .post -->

						<div class="loop-footer">
							<!-- Previous/Next page navigation -->
							<div class="loop-utility clearfix">
								<div class="alignleft"><?php 
            next_post_link('%link', __('&larr; Next Post', 'it-l10n-Builder-Paige'), FALSE);
            ?>
</div>
								<div class="alignright"><?php 
            previous_post_link('%link', __('Previous Post &rarr;', 'it-l10n-Builder-Paige'), FALSE);
            ?>
</div>
							</div>
						</div>

					<?php 
            comments_template();
            // include comments template
            ?>
				<?php 
        }
        // end of one post
        ?>
			</div>
		</div>
	<?php 
    } else {
        // do not delete
        ?>
		<?php 
        do_action('builder_template_show_not_found');
        ?>
	<?php 
    }
    // do not delete
}
Beispiel #26
0
function cyberchimps_page()
{
    ?>
<div id="container" <?php 
    cyberchimps_filter_container_class();
    ?>
>
	
	<?php 
    do_action('cyberchimps_before_content_container');
    ?>
	
	<div id="content" <?php 
    cyberchimps_filter_content_class();
    ?>
>
		
		<?php 
    do_action('cyberchimps_before_content');
    ?>
		
		<?php 
    while (have_posts()) {
        the_post();
        ?>

			<?php 
        get_template_part('content', 'page');
        ?>

			<?php 
        // 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('', true);
        }
        ?>

		<?php 
    }
    // end of the loop.
    ?>
	
		<?php 
    do_action('cyberchimps_after_content');
    ?>
		
	</div><!-- #content -->
	
	<?php 
    do_action('cyberchimps_after_content_container');
    ?>
		
</div><!-- #container .row-fluid-->
<?php 
}
 /**
  * 
  */
 public function review_redirect()
 {
     global $wp_query;
     // if this is not a request for reviews or a singular object of restaurants then bail
     if (!isset($wp_query->query_vars['reviews']) || !is_singular('restaurants')) {
         return;
     }
     // include custom template for reviews
     comments_template();
     exit;
 }
    /**
     * Frontend Shortcode Handle.
     * @param  array  $atts      Array of attributes.
     * @param  string $content   Text within enclosing form of shortcode element.
     * @param  string $shortcode The shortcode found, when == callback name.
     * @param  string $meta      Meta data.
     * @return string            Returns the modified html string.
     */
    public function shortcode_handle($atts, $content = '', $shortcode = '', $meta = '')
    {
        ob_start();
        ?>
		<div class="axiscomposer ac-comments">
			<?php 
        comments_template();
        ?>
		</div>
		<?php 
        return ob_get_clean();
    }
function ym_fbook_template()
{
    global $facebook_settings, $facebook_client;
    //aborts
    if (is_single() && $facebook_settings->post_breakout) {
        add_action('wp_head', 'ym_fbook_iframe_breakout');
        return;
    }
    if (is_page() && $facebook_settings->page_breakout) {
        add_action('wp_head', 'ym_fbook_iframe_breakout');
        return;
    }
    // since inside init
    // call scripts
    wp_enqueue_style('jquery-ui', 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery.ui.all.css');
    wp_enqueue_script('ym-fb-nav', site_url('wp-content/plugins/ym_facebook/js/fb_nav.js'), array('jquery'), YM_FB_PLUGIN_VERSION);
    wp_enqueue_script('ym-fb', site_url('wp-content/plugins/ym_facebook/js/fb.js'), array('jquery'), YM_FB_PLUGIN_VERSION);
    wp_enqueue_style('ym-fb', site_url('wp-content/plugins/ym_facebook/css/ym_fbook.css'), array(), YM_FB_PLUGIN_VERSION);
    wp_enqueue_style('ym-fb-login', site_url('wp-content/plugins/ym_facebook/css/ym_fbook_login.css'), array(), YM_FB_PLUGIN_VERSION);
    wp_enqueue_script('jquery-ui-ymenu', site_url('wp-content/plugins/ym_facebook/js/jquery.ymenu.js'), array('jquery'));
    wp_enqueue_style('jquery-ui-ymenu', site_url('wp-content/plugins/ym_facebook/css/jquery.ymenu.css'));
    // aborts
    if (defined('YM_FBOOK_NO_LOOP') || defined('FBOOK_TEMPLATE_OVERRIDE')) {
        include YM_FBOOK_BASE_DIR . '/template/head.php';
        if (defined('FBOOK_TEMPLATE_OVERRIDE')) {
            include YM_FBOOK_BASE_DIR . '/template/' . FBOOK_TEMPLATE_OVERRIDE . '.php';
        } else {
            if ($_GET['login']) {
                ym_fbook_wp_login_form();
            }
        }
        include YM_FBOOK_BASE_DIR . '/template/foot.php';
        exit;
    }
    if ($facebook_settings->enable_fb_php) {
        if (locate_template('fb.php', TRUE)) {
            exit;
        }
    }
    // catch non permalinks
    if ($_GET['p']) {
        query_posts('p=' . $_GET['p']);
    }
    if ($_GET['page_id']) {
        query_posts('page_id=' . $_GET['page_id']);
    }
    include YM_FBOOK_BASE_DIR . '/template/head.php';
    include YM_FBOOK_BASE_DIR . '/template/loop.php';
    // comments
    comments_template('', TRUE);
    include YM_FBOOK_BASE_DIR . '/template/foot.php';
    exit;
}
function _wpbdp_render_single()
{
    global $post;
    $html = '';
    $sticky_status = wpbdp_listings_api()->get_sticky_status($post->ID);
    $html .= sprintf('<div id="wpbdp-listing-%d" class="wpbdp-listing wpbdp-listing-single %s %s %s" itemscope itemtype="http://schema.org/LocalBusiness">', $post->ID, 'single', $sticky_status, apply_filters('wpbdp_listing_view_css', '', $post->ID));
    $html .= apply_filters('wpbdp_listing_view_before', '', $post->ID, 'single');
    $html .= wpbdp_capture_action('wpbdp_before_single_view', $post->ID);
    $sticky_tag = '';
    if ($sticky_status == 'sticky') {
        $sticky_tag = sprintf('<div class="stickytag"><img src="%s" alt="%s" border="0" title="%s"></div>', WPBDP_URL . 'core/images/featuredlisting.png', _x('Featured Listing', 'templates', 'WPBDM'), the_title(null, null, false));
    }
    $d = WPBDP_ListingFieldDisplayItem::prepare_set($post->ID, 'listing');
    $listing_fields = implode('', WPBDP_ListingFieldDisplayItem::walk_set('html', $d->fields));
    $social_fields = implode('', WPBDP_ListingFieldDisplayItem::walk_set('html', $d->social));
    // images
    $thumbnail_id = wpbdp_listings_api()->get_thumbnail_id($post->ID);
    $images = wpbdp_listings_api()->get_images($post->ID);
    $extra_images = array();
    if (wpbdp_get_option('allow-images')) {
        foreach ($images as $img) {
            // create thumbnail of correct size if needed (only in single view to avoid consuming server resources)
            _wpbdp_resize_image_if_needed($img->ID);
            if ($img->ID == $thumbnail_id) {
                continue;
            }
            $full_image_data = wp_get_attachment_image_src($img->ID, 'wpbdp-large', false);
            $full_image_url = $full_image_data[0];
            $extra_images[] = sprintf('<a href="%s" class="thickbox" data-lightbox="wpbdpgal" rel="wpbdpgal" target="_blank">%s</a>', $full_image_url, wp_get_attachment_image($img->ID, 'wpbdp-thumb', false, array('class' => 'wpbdp-thumbnail size-thumbnail', 'alt' => the_title(null, null, false), 'title' => the_title(null, null, false))));
        }
    }
    $vars = array('actions' => wpbdp_render('parts/listing-buttons', array('listing_id' => $post->ID, 'view' => 'single'), false), 'is_sticky' => $sticky_status == 'sticky', 'sticky_tag' => $sticky_tag, 'title' => get_the_title(), 'main_image' => wpbdp_get_option('allow-images') ? wpbdp_listing_thumbnail(null, 'link=picture&class=wpbdp-single-thumbnail') : '', 'listing_fields' => apply_filters('wpbdp_single_listing_fields', $listing_fields, $post->ID), 'fields' => $d->fields, 'listing_id' => $post->ID, 'extra_images' => $extra_images);
    $vars = apply_filters('wpbdp_listing_template_vars', $vars, $post->ID);
    $vars = apply_filters('wpbdp_single_template_vars', $vars, $post->ID);
    $html .= wpbdp_render('businessdirectory-listing', $vars, true);
    $social_fields = apply_filters('wpbdp_single_social_fields', $social_fields, $post->ID);
    if ($social_fields) {
        $html .= '<div class="social-fields cf">' . $social_fields . '</div>';
    }
    $html .= apply_filters('wpbdp_listing_view_after', '', $post->ID, 'single');
    $html .= wpbdp_capture_action('wpbdp_after_single_view', $post->ID);
    if (wpbdp_get_option('show-comment-form')) {
        $html .= '<div class="comments">';
        ob_start();
        comments_template(null, true);
        $html .= ob_get_contents();
        ob_end_clean();
        $html .= '</div>';
    }
    $html .= '</div>';
    return $html;
}