| 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
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'orderby' => 'rand',
'showposts' => 3
);
$related_query = new WP_Query($args);
if ($related_query->have_posts()) { ?>
<div class="related-posts"><div class="related-content">
<h5 class="related-posts_h"><span><?php echo theme_locals("blog_related"); ?></span></h5>
<div class="row">
<?php
while ($related_query->have_posts()) : $related_query->the_post();
$thumb = get_post_thumbnail_id();
$img_url = wp_get_attachment_url($thumb,'full');
$img_width = 540;
$img_height = 640;
$img = aq_resize( $img_url, $img_width, $img_height, true, true, true );
?>
<div class="col-sm-4 col-md-4 col-lg-4">
<div class="post-list_h">
<div class="hercules-related-default" style="<?php if($img) {echo 'background-image:url('.esc_url($img).');';} ?>">
<a href="<?php esc_url(the_permalink()); ?>" title="<?php esc_attr(the_title()); ?>" class="hercules-related-default-link">
<?php if(has_post_format('video')){
echo '<div class="cover-video"></div>';
} ?>
</a>
</div>
<div class="post-list-inner">
<h6><a href="<?php esc_url(the_permalink()) ?>" > <?php esc_attr(the_title());?> </a></h6>
<?php novablog_post_meta(array('date', 'views'), false, 'meta-space-top'); ?>
</div>
</div></div>
<?php
endwhile;
?>
</div>
</div></div>
<?php }
wp_reset_postdata();
} ?>