HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux acmehomecare 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: www-data (33)
PHP: 8.0.30
Disabled: 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,
Upload Files
File: /var/www/html/wp-content/themes/exertio/template-parts/detail-page/services/related-services.php
<?php
$is_related = fl_framework_get_options('service_related_posts');
if(isset($is_related) && $is_related == 1)
{
	$related_post_count = 4;
	$related_post_count = fl_framework_get_options('service_related_posts_count');
	$sid	=	get_the_ID();
	$cats = wp_get_post_terms( $sid, 'service-categories' );
	$categories	=	array();
	foreach( $cats as $cat )
	{
		$categories[]	=	$cat->term_id;
	}
	$args = array(
		'post_type' => 'services',
		'posts_per_page' => $related_post_count,
		'order'=> 'DESC',
		'post__not_in'	=> array( $sid ),
		'meta_query' => array(
			array(
				'key' => '_service_status',
				'value' => 'active',
				'compare' => '=',
				),
			),
		'tax_query' => array(
			array(
			'taxonomy' => 'service-categories',
			'field' => 'id',
			'terms' => $categories,
			'operator'=> 'IN'
		)));

	$results = new WP_Query( $args );
	if(isset($results) && $results != '' && $results->found_posts > 0)
	{
		?>
		<div class="col-lg-12 col-xs-12 col-sm-12 col-md-12 col-xl-12">
			<div class="related-posts"  id="related">
				<div class="heading-contents">
				  <h3><?php echo fl_framework_get_options('service_related_posts_title'); ?> </h3>
				</div>
				<div class="recomended-slider owl-carousel owl-theme">
				<?php		
					$list_type = 'grid_1';
					$servicce_list_style = fl_framework_get_options('service_grid_style');
					if(isset($servicce_list_style) && $servicce_list_style != '')
					{
						$list_type = $servicce_list_style;
					}
					
					$layout_type = new exertio_get_services();
					while ($results->have_posts())
					{
						$results->the_post();
						$service_id = get_the_ID();
						$function = "exertio_listings_$list_type";
						$fetch_output = $layout_type->$function($service_id, 'item');
						echo ' '.$fetch_output;
					}
				?>
				</div>
			</div>
		</div>
		<?php
	}
}
?>