Пример #1
0
<?php

global $withcomments;
$withcomments = true;
$is_endless_template = xt_is_endless_template();
$comments_enabled = xt_comments_enabled();
$comments_system = xt_comments_system();
$has_composer = xt_page_has_composer();
if ($comments_enabled) {
    ?>

	<?php 
    if (!empty($has_composer)) {
        ?>
	<div class="vc_row wpb_row vc_row-fluid in-container">
		<div class="vc_col-sm-12 vc_col-md-12 vc_col-xs-12 wpb_column vc_column_container">
			<article>
				<div class="article-content">
	<?php 
    }
    ?>
							
			
								
		<div class="comments-top" style="width:100%; height:1px;"></div>
		
		<div id="comments_<?php 
    the_ID();
    ?>
">
		
Пример #2
0
function xt_post_stats($linkComments = true, $classes = array())
{
    $post_id = get_the_ID();
    $comments_enabled = xt_comments_enabled();
    $comments_system = xt_comments_system();
    $likes_enabled = (bool) xt_option('likes_enabled');
    $viewsCount = xt_get_post_views($post_id);
    ?>
	
	<div class="stats <?php 
    echo implode(" ", $classes);
    ?>
">
		<span class="stats-wrap">
			
			<?php 
    if ($likes_enabled) {
        $likesCount = xt_get_post_likes($post_id);
        ?>
			<span class="likes"><i class="fa fa-thumbs-up"></i> <?php 
        echo $likesCount;
        ?>
</span>
			<meta itemprop="interactionCount" content="UserLikes:<?php 
        echo $likesCount;
        ?>
"/>
			<?php 
    }
    ?>

			<span class="views"><i class="fa fa-eye"></i> <?php 
    echo $viewsCount;
    ?>
</span>
			<meta itemprop="interactionCount" content="UserPageVisits:<?php 
    echo $viewsCount;
    ?>
"/>
			
			<?php 
    if ($comments_enabled && $comments_system != 'facebook') {
        ?>
			<span class="comments">
				<?php 
        $commentsCount = get_comments_number();
        ?>
	
				<?php 
        if ($linkComments) {
            ?>
					<a href="<?php 
            echo esc_url(get_comments_link($post_id));
            ?>
"><i class="fa fa-comment"></i> <?php 
            echo $commentsCount;
            ?>
</a>
				<?php 
        } else {
            ?>
					<i class="fa fa-comment"></i> <?php 
            echo $commentsCount;
            ?>
				<?php 
        }
        ?>
				<meta itemprop="interactionCount" content="UserComments:<?php 
        echo $commentsCount;
        ?>
"/>
			</span>
			<?php 
    }
    ?>
			
		</span>
	</div>
	
    <?php 
}
Пример #3
0
 function set_comments_type()
 {
     global $post;
     $comments_enabled = xt_comments_enabled();
     $comments_system = xt_comments_system();
     $disqus = get_option('disqus_active');
     if (function_exists('is_product') && is_product()) {
         update_option('disqus_active', '0');
     } else {
         if ($post && !empty($comments_enabled)) {
             if ($comments_system != 'disqus') {
                 update_option('disqus_active', '0');
             } else {
                 if ($comments_system == 'disqus') {
                     update_option('disqus_active', '1');
                 }
             }
         }
     }
 }