-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-contact-page.php
72 lines (57 loc) · 2.08 KB
/
template-contact-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
<?php
/**
* Template Name: Contact page
* The dedicated page template for maintenance subscription
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Studio Val
*/
get_header();
// === ACF Data
$text = get_field('text');
$form_shortcode = get_field('form_shortcode');
$sidebar_blocks = [
get_field('block_1'),
get_field('block_2'),
];
$blocks = [
studio_define_graphic_block('primary', 'large'),
studio_define_graphic_block('dark', 'medium'),
studio_define_graphic_block('dark', 'large'),
];
?>
<main id="content" class="st-template-contact-page st-contact st-section boxed">
<section class="st-section boxed st-contact__content">
<?php echo $text; ?>
<div class="st-contact__form">
<?php echo do_shortcode($form_shortcode); ?>
</div>
</section>
<aside class="st-contact__sidebar">
<?php if (!empty($sidebar_blocks)) : foreach ($sidebar_blocks as $block) : ?>
<div class="st-contact__block">
<span><?php echo $block['title']; ?></span>
<p><?php echo $block['text']; ?></p>
<?php if (array_key_exists('social_networks', $block)) : ?>
<div class="st-contact__block--socials">
<?php foreach ($block['social_networks'] as $social) : ?>
<a href="<?php echo esc_attr($social['link']['url']); ?>" title="<?php echo esc_attr($social['link']['title']); ?>" target="<?php echo esc_attr($social['link']['target']); ?>">
<?php if ($social['image']) : ?>
<img src="<?php echo esc_url($social['image']['url']) ?>" alt="<?php echo esc_attr($social['image']['alt']) ?>" />
<?php endif; ?>
</a>
<?php endforeach ?>
</div>
<?php endif; ?>
<?php if (array_key_exists('button', $block)) : ?>
<?php get_template_part('template-parts/button', null, $block['button']); ?>
<?php endif; ?>
</div>
<?php endforeach;
endif; ?>
</aside>
<?php echo studio_generate_graphic_blocks($blocks); ?>
</main>
<?php
get_footer();