-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-heroes.php
43 lines (33 loc) · 1.3 KB
/
page-heroes.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
<?php get_header(); ?>
<section class="container-fluid text-center hp__section heroes" style="background:linear-gradient(rgba(0, 0, 0, -0.7), rgba(0, 0, 0, 0.7)), url(<?php the_field('background_image') ;?>);">
<h2>
<?php the_field('title') ;?>
</h2>
</section>
<?php
$count = 0;
$heroesSection = new WP_Query(array(
'posts_per_page' => -1,
'post_type' => 'heroes'
));
while($heroesSection -> have_posts()) {
$count++;
$heroesSection->the_post(); ?>
<section class="container-fluid hp__section hero_<?php echo $count; ?>" >
<h2 class="h1"><?php the_field('hero_name') ;?></h2>
<ul class="unstyled-list">
<li><?php the_field('hero_copy') ;?></li>
</ul>
</section>
<style>
.hero_<?php echo $count; ?> {
background: linear-gradient(rgba(0, 0, 0, -0.7), rgba(0, 0, 0, 0.7)), url(<?php the_field('hero_background_image') ;?>);
}
@media (max-width: 500px) {
.hero_<?php echo $count; ?> {
background: linear-gradient(rgba(0, 0, 0, -0.7), rgba(0, 0, 0, 0.7)), url(<?php the_field('mobile_image') ;?>);
}
}
</style>
<?php } wp_reset_query(); ?>
<?php get_footer(); ?>