forked from SayflyAM/Amir-Travel-Europe---Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-tour.php
More file actions
146 lines (126 loc) · 6.69 KB
/
Copy patharchive-tour.php
File metadata and controls
146 lines (126 loc) · 6.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* Archive Tour Template
*
* @package Amir Travel Europe
*/
get_header();
?>
<div class="container my-5">
<header class="page-header mb-5 text-center">
<h1><?php echo esc_html__( 'جميع الجولات السياحية', 'amir-travel-europe' ); ?></h1>
<p><?php echo esc_html__( 'اكتشف أفضل الجولات الأوروبية مع سائق عربي محترف', 'amir-travel-europe' ); ?></p>
</header>
<!-- Filter Section -->
<div class="tour-filters mb-5">
<div class="row">
<div class="col-md-4">
<?php
$countries = get_terms( array(
'taxonomy' => 'country',
'hide_empty' => true,
) );
if ( ! empty( $countries ) && ! is_wp_error( $countries ) ) : ?>
<select id="filter-country" class="form-control">
<option value=""><?php echo esc_html__( 'جميع الدول', 'amir-travel-europe' ); ?></option>
<?php foreach ( $countries as $country ) : ?>
<option value="<?php echo esc_attr( $country->slug ); ?>">
<?php echo esc_html( $country->name ); ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
</div>
<div class="col-md-4">
<?php
$tour_types = get_terms( array(
'taxonomy' => 'tour-type',
'hide_empty' => true,
) );
if ( ! empty( $tour_types ) && ! is_wp_error( $tour_types ) ) : ?>
<select id="filter-type" class="form-control">
<option value=""><?php echo esc_html__( 'جميع الأنواع', 'amir-travel-europe' ); ?></option>
<?php foreach ( $tour_types as $type ) : ?>
<option value="<?php echo esc_attr( $type->slug ); ?>">
<?php echo esc_html( $type->name ); ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
</div>
<div class="col-md-4">
<select id="filter-duration" class="form-control">
<option value=""><?php echo esc_html__( 'جميع المدد', 'amir-travel-europe' ); ?></option>
<option value="3"><?php echo esc_html__( '3 أيام', 'amir-travel-europe' ); ?></option>
<option value="5"><?php echo esc_html__( '5 أيام', 'amir-travel-europe' ); ?></option>
<option value="7"><?php echo esc_html__( '7 أيام', 'amir-travel-europe' ); ?></option>
<option value="14"><?php echo esc_html__( '14 يوم', 'amir-travel-europe' ); ?></option>
</select>
</div>
</div>
</div>
<div class="row">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
$price = get_post_meta( get_the_ID(), '_tour_price', true );
$currency = get_post_meta( get_the_ID(), '_tour_currency', true );
$duration = get_post_meta( get_the_ID(), '_tour_duration', true );
$countries = get_the_terms( get_the_ID(), 'country' );
?>
<div class="col-md-4">
<div class="tour-card">
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'medium_large', array( 'class' => 'tour-card-img' ) ); ?>
</a>
<?php else : ?>
<img src="<?php echo esc_url( get_template_directory_uri() . '/images/no-image.png' ); ?>" alt="<?php the_title(); ?>" class="tour-card-img">
<?php endif; ?>
<div class="tour-card-body">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="tour-meta">
<?php if ( $countries && ! is_wp_error( $countries ) ) : ?>
<span class="tour-country">
<i class="fas fa-map-marker-alt"></i> <?php echo esc_html( $countries[0]->name ); ?>
</span>
<?php endif; ?>
<?php if ( $duration ) : ?>
<span class="tour-duration">
<i class="fas fa-clock"></i> <?php echo esc_html( $duration ); ?> <?php echo esc_html__( 'أيام', 'amir-travel-europe' ); ?>
</span>
<?php endif; ?>
</div>
<div class="tour-excerpt">
<?php echo wp_trim_words( get_the_excerpt(), 15 ); ?>
</div>
<?php if ( $price ) : ?>
<div class="tour-price">
<?php echo esc_html( $price ); ?> <?php echo esc_html( $currency ); ?>
</div>
<?php endif; ?>
<a href="<?php the_permalink(); ?>" class="btn btn-amir-primary btn-sm mt-3">
<?php echo esc_html__( 'التفاصيل', 'amir-travel-europe' ); ?>
</a>
</div>
</div>
</div>
<?php
endwhile;
// Pagination
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( '« السابق', 'amir-travel-europe' ),
'next_text' => __( 'التالي »', 'amir-travel-europe' ),
) );
else :
?>
<div class="col-12">
<p class="text-center"><?php echo esc_html__( 'لا توجد جولات متاحة حالياً', 'amir-travel-europe' ); ?></p>
</div>
<?php
endif;
?>
</div>
</div>
<?php get_footer(); ?>