-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
156 lines (122 loc) · 4.45 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
148
149
150
151
152
153
154
155
156
<section class="section work">
<div class="container">
<h2 id="work" class="section__title">Lucrari</h2>
<ul class="work__list">
<?php
$categories = get_categories( array(
'orderby' => 'name',
'order' => 'ASC'
) );
$display = false;
foreach ($categories as $index=>$category) {
// Get only image url
$params = array(
'term_id' => $category->term_id,
'size' => 'full'
);
$src = category_image_src( $params , $display );
echo '<li class="work__item';
if ($index == 0) { echo ' is-active'; };
echo '" style="background-image: url('. $src .')" data-action="pick-category" data-category-id="'.$category->term_id.'">';
echo '<h3 class="work__title">'.$category->cat_name.'</h3>';
// echo '<pre>'.var_dump($category).'</pre>';
echo '</li>';
}
?>
</ul>
<div class="piece__container" data-showcase="pieces">
<?php
foreach ($categories as $index=>$category) {
$args = array('post_type' => 'lucrare', 'orderby' => 'name', 'post_status' => 'publish', 'posts_per_page'=>'-1', 'cat' => $category->term_id);
$wp_query = new WP_Query($args);
// The Loop
if($wp_query->have_posts()):
echo '<ul class="piece__list" data-show="pick-category" data-category-id="'.$category->term_id.'">';
while($wp_query->have_posts()) : $wp_query->the_post();
echo '<li class="piece__item">';
$images = get_field('poze');
$price = get_field('pret');
$title = get_field('titlu');
echo '<a href="'.$images[0]['url'].'" class="piece__inner" data-lightbox="'.get_the_ID().'">';
echo '<div class="piece__image" style="background-image: url('.$images[0]['url'].')"></div>';
echo '<div class="piece__info">';
echo '<h4 class="piece__name">';
the_title();
echo '</h4>';
if ($title != '') {
echo '<h5 class="piece__title">'.$title.'</h5>';
}
echo the_field('info');
if ($price != '') {
echo '<p class="piece__price">Pretul lucrarii: <strong>'.$price.'</strong></p>';
}
echo '</div>';
echo '</a>';
if (count($images) > 1) {
for($i = 1; $i < count($images); ++$i) {
echo '<a href="'.$images[$i]['url'].'" style="display: none;" data-lightbox="'.get_the_ID().'"></a>';
}
}
echo '</li>';
endwhile;
echo '</ul>';
else:
echo 'no posts';
endif;
wp_reset_postdata();
}
?>
</div>
<br>
<hr class="center">
<br>
<p>
Preturile mentionate in descrierea lucrarilor au rol orientativ.
</p>
<p>
Pretul unei lucrari este stabilit individual, dupa consultarea clientului, luand in considerare amploarea si dimensiunea lucrarii, dificiultatea acesteia, materialele selectate, timpul necesar executiei, locatia lucrarii, precum si alte particularitati ale acesteia.
</p>
</div>
</section>
<div id="about" class="splitter">
<?php
$query = new WP_query('pagename=despre');
// The Loop
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
?>
<div class="about__left" style="background-image: url(<?php echo $feat_image; ?>)"></div>
<div class="about__right">
<div class="container--hr">
<section class="section about">
<h2 class="section__title">Despre</h2>
<?php the_content(); ?>
</section>
</div>
</div>
<?php
}
}
wp_reset_postdata();
?>
</div>
<section class="section contact">
<div class="container">
<h2 id="contact" class="section__title">Contact</h2>
<?php
$query = new WP_query('pagename=contact');
// The Loop
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
echo '<div class="contact-grid">';
the_content();
echo '</div>';
}
}
wp_reset_postdata();
?>
</div>
</section>