%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/friendstravel.al/wp-content/plugins/travel-booking/templates/single-tour/
Upload File :
Create Path :
Current File : /var/www/html/friendstravel.al/wp-content/plugins/travel-booking/templates/single-tour/related.php

<?php
/**
 * Related Tours
 * @author: Physcode
 */

if ( !defined( 'ABSPATH' ) ) {
	exit;
}

global $product;

if ( empty( $product ) || !$product->exists() ) {
	return;
}
$posts_per_page = 3;
$option_related = array(
	'post_type'           => 'product',
	'post_status'         => 'publish',
	'ignore_sticky_posts' => 1,
	'no_found_rows'       => 1,
	'posts_per_page'      => $posts_per_page,
	'orderby'             => 'rand',
	'post__not_in'        => array( $product->ID ),
	'tax_query'           => array(
		array(
			'taxonomy' => 'product_type',
			'field'    => 'slug',
			'terms'    => array( 'tour_phys' ),
			'operator' => 'IN',
		)
	),
);

if ( get_option( 'tour_expire_on_list' ) && get_option( 'tour_expire_on_list' ) == 'no' ) {
	$option_related['meta_query'] = array(
		array(
			'key'     => '_date_finish_tour',
			'compare' => '>=',
			'value'   => date( 'Y-m-d' ),
			'type'    => 'DATE',
		)
	);
}
$args = apply_filters( 'tb_related_tour_args', $option_related );


$products = new WP_Query( $args );

if ( $products->have_posts() ) : ?>

	<div class="related tours">

		<h2><?php _e( 'Related Tours', 'travel-booking' ); ?></h2>
		<ul class="tours products wrapper-tours-slider">
			<?php while ( $products->have_posts() ) : $products->the_post(); ?>

				<?php tb_get_file_template( 'content-tour.php', false ); ?>

			<?php endwhile; // end of the loop. ?>
		</ul>
	</div>

<?php endif;

wp_reset_postdata();

Zerion Mini Shell 1.0