| Server IP : 81.2.241.106 / Your IP : 216.73.216.165 Web Server : Apache/2.4.67 (Debian) System : Linux tranq-f.bakta.org 5.10.0-45-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : lisky ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/lisky/wp-content/themes/hitmag/template-parts/ |
Upload File : |
<?php
$categories = get_the_category();
if ( $categories ) { ?>
<div class="hm-related-posts">
<div class="wt-container">
<h4 class="widget-title"><?php _e( 'Related Posts', 'hitmag' ); ?></h4>
</div>
<div class="hmrp-container">
<?php
$first_category = esc_attr( $categories[0]->term_id );
$args = array(
'cat' => array($first_category),
'post__not_in' => array($post->ID),
'posts_per_page' => 3,
'ignore_sticky_posts' => true
);
// Filter for Related Posts query arguments.
$args = apply_filters( 'hitmag_related_posts_query_arguments', $args );
$related_posts = new WP_Query($args);
if( $related_posts->have_posts() ) :
while ($related_posts->have_posts()) : $related_posts->the_post(); ?>
<div class="hm-rel-post">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail( 'hitmag-grid' ); ?>
</a>
<h3 class="post-title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h3>
<p class="hms-meta"><?php echo hitmag_posted_datetime() ?></p>
</div>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
</div>
</div>
<?php
}