-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
147 lines (129 loc) · 3.9 KB
/
front-page.php
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
147
<?php
/**
* Template Name: Home Template
*
* @package gozal
*/
get_header();
?>
<!-- ------------------------------------------------Include About Page --------------------------->
<div class="container-lg">
<section >
<?php
$found_post=null;
if ( $posts = get_posts( array(
'name' => 'about-us',
'post_type' => 'page',
'post_status' => 'publish',
) ) ) $found_post = $posts[0];
if ( ! is_null( $found_post ) ){
?>
<div class="content about">
<div class="unit-a bg-transparent ">
<div class="a-1" >
<div class="post-a">
<?php
echo apply_filters('the_content', $found_post->post_content);
?>
<a class="btn btn-success text-white " href="<?php echo esc_url(the_permalink($found_post->ID)); ?>">
<?php esc_html_e('read more','gozal') ?>
<img src="<?php echo GOZAL_DIR_URI ?>/assets/symbol/left.svg" alt="left" width="20px" height="20px" >
</a>
</div>
<!-- post-a -->
</div>
<!-- a-1 -->
<div class="a-2" >
<?php echo get_the_post_thumbnail($found_post->ID);?>
</div>
</div>
<!-- unit-a unit-aa -->
</div>
<!-- content -->
<?php
}
?>
<!-- ------------------------------------------------Include 3 BLOG POST --------------------------->
<?php
$args=array(
'post_type' => 'post',
'category_name' => 'home',
'post_per_page' => 3,
'post_status' => 'publish',
);
$_posts = new WP_Query( $args );
?>
<?php
if($_posts->have_posts()):
?>
<?php
$a=0;
$image = wp_get_attachment_url(get_post_thumbnail_id(get_the_ID()));
while($_posts->have_posts()):$_posts->the_post();
$a++;
?>
<div class="content">
<div class="unit-b <?php echo ($a % 2) ? '' : 'unit-c'; ?>">
<div class="b-1">
<div class="b-1-a">
<div class="b-inner">
<h2>
<a href="<?php echo esc_url(get_permalink()) ?>">
<?php
the_title();
?>
</a>
</h2>
<p>
<?php
echo gozal_the_excerpt(20);
?>
</p>
<!-- <a class="btn btn-success" href="<?php //echo permalink_link() ?>"></a> -->
</div>
</div>
</div>
<!--b-1 -->
<div class="b-2">
<?php echo get_the_post_thumbnail(); ?>
</div>
<!--b-2 -->
</div>
<!--unit-b -->
</div>
<!--contect-->
<?php endwhile ;?>
<?php endif; ?>
<!-- ------------------------------------------------Include contact-US Page --------------------------->
<?php
$found_post = null;
if ( $posts = get_posts( array(
'name' => 'contact-us',
'post_type' => 'page',
'post_status' => 'publish',
) ) ) $found_post = $posts[0];
if ( ! is_null( $found_post ) ){
?>
<article id="post-<?php the_ID(); ?>" >
<div class="content contact " >
<div class="unit-a unit-aa bg-transparent " >
<div class="a-1" style="width: 65%;">
<div class="connect">
<?php echo apply_filters('the_content', $found_post->post_content); ?>
</div>
</div>
<div class="a-2 a-2a" style="width: 70%;">
<iframe src="<?php echo get_option('addres_google_map') ?>" width="550" height="400" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
</div>
</div>
</div>
</article>
<?php
}
?>
</section>
</div>
<!--container -->
<?php
get_footer();
?>