/
page-career-blocks.php
76 lines (55 loc) · 1.59 KB
/
page-career-blocks.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
<?php
/**
* Template Name: Career block page
*/
get_header(); ?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<header id="site-content" class="page-top">
<h1 class="page-top__title"><?php the_title(); ?></h1>
<div class="page-top__descr">
<?php the_content(); ?>
</div>
<?php if ( has_post_thumbnail() ) : ?>
<div class="page-top__thumb">
<?php
the_post_thumbnail(
'large',
array('class' => 'page-top__img')
);
?>
</div>
<?php endif; ?>
</header>
<?php endwhile; endif; ?>
<?php
if( have_rows('career_content_blocks') ):
// loop through the rows of data
while ( have_rows('career_content_blocks') ) : the_row();
$section_id = strtolower(get_sub_field('career_content_title'));
$section_id = str_replace(" ", "", $section_id); ?>
<hr class="divider">
<section class="career__block"
id="<?php echo $section_id; ?>">
<h2 class="about__sub-title">
<?php the_sub_field('career_content_title'); ?>
</h2>
<?php $wide = (get_sub_field('wide')) ? 'career__description--wide' : ''; ?>
<div class="career__description <?php echo $wide; ?>">
<?php the_sub_field('career_content_info'); ?>
</div>
<?php
$button_url = get_sub_field('career_content_button_url');
$button_text = get_sub_field('career_content_button_text');
if($button_url && $button_text):
?>
<a class="button committees__all" href="<?php echo $button_url; ?>">
<?php echo $button_text; ?>
</a>
<?php endif; ?>
</section>
<?php endwhile;
else :
echo "no content found";
endif;
?>
<?php get_footer(); ?>