| Server IP : 213.186.33.4 / Your IP : 216.73.216.222 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/themes/novablog/post-template/ |
Upload File : |
<?php
$args=array(
'orderby' => 'meta_value_num',
'order' => 'DESC',
'meta_key' => '_hercules_likes',
'showposts' => 4, // these are the number of most commented posts we want to display
'ignore_sticky_posts' => 1 // to exclude the sticky post
);
$counter = 1;
$most_commented = new WP_Query($args);
if ($most_commented->have_posts()) { ?>
<div class="most-commented-section"><div class="most-commented-content">
<h5 class="most-commented-posts"><span><?php echo theme_locals("most_popular"); ?></span></h5>
<div class="row">
<?php
while ($most_commented->have_posts()) : $most_commented->the_post();
$thumb = get_post_thumbnail_id();
$img_url = wp_get_attachment_url( $thumb,'full');
$img_width = 340;
$img_height = 320;
$img = aq_resize( $img_url, $img_width, $img_height, true, true, true );
?>
<div class="col-xs-6 col-sm-3 col-md-3 col-lg-3">
<header class="post-header">
<?php if(has_post_thumbnail()) { ?>
<figure class="featured-thumbnail thumbnail large">
<a href="<?php esc_url(the_permalink()); ?>" title="<?php esc_attr(the_title()); ?>">
<?php if(has_post_format('video')){
echo '<div class="cover-video"></div>';
} ?>
<img src="<?php echo esc_url($img); ?>" width="<?php echo esc_attr($img_width); ?>" height="<?php echo esc_attr($img_height); ?>" alt="<?php esc_attr(the_title());?>" /></a>
</figure>
<?php } ?>
<div class="most-commented-text-container">
<h5 class="post-title"><a href="<?php esc_url(the_permalink()); ?>" title="<?php esc_attr(the_title()); ?>"><?php esc_attr(the_title()); ?></a></h5>
<?php if (novablog_getVariable('post_date')=='yes' or novablog_getVariable('post_date')=='') {novablog_post_meta(array('date'), false, 'meta-space-top');} ?>
<div class="most-commented-excerpt">
<?php
$content = get_the_content();
echo novablog_limit_text($content,6);
?>
</div></div>
</header>
</div>
<?php
$counter ++ ;
endwhile;
?>
</div>
</div></div>
<?php
wp_reset_postdata();
}
?>