-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-product.php
executable file
·127 lines (102 loc) · 3.11 KB
/
page-product.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
<?php
/*
Template Name: Product pagina
*/
get_header(); ?>
<main class="main" role="main">
<section class="product-intro clear">
<div class="product-image">
<?php the_post_thumbnail(); ?>
</div>
<div class="product-incentives">
<h1><?php the_title(); ?></h1>
<p class="product-meta"><?php the_field('date');?></p>
<?php the_field('incentives');?>
<div>
</section>
<section class="main-product-info clear">
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class('main-product-content'); ?>>
<?php the_content(); ?>
<br class="clear">
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else: ?>
<!-- article -->
<article>
<h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>
</article>
<!-- /article -->
<?php endif; ?>
<div class="main-product-cta">
<?php the_field('cta_description');?>
<?php
$cta_url = get_field('cta_url');
$cta_form = get_field('cta_form');
if( $cta_url != '' ){ ?>
<a class="cta-bttn-sml" href="<?php the_field('cta_url'); ?>"><?php the_field('cta_txt'); ?></a>
<?php } else { ?>
<?php echo $cta_form; ?>
<?php } ?>
</div>
</section>
<section class="product-persuasion clear">
<article class="persuasion-text">
<?php the_field('persuasions'); ?>
</article>
<div class="product-testimonials">
<?php
$page_slug = $post->post_name;
$args = array(
'post_type' => 'testimonial',
'category_name' => $page_slug,
'posts_per_page' => 1,
'orderby' => 'rand'
);
?>
<?php $posts = new WP_Query( $args ); ?>
<?php if ( $posts->have_posts() ): ?>
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
<article class="product-testimonial">
<span class="portrait">
<?php if (has_post_thumbnail() ){
the_post_thumbnail( array(200, 200));
}?>
</span>
<span><?php the_title();?></span>
<?php the_content();?>
</article>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<!--<p><?php _e( 'Geen testimonial gevonden' ); ?></p>-->
<?php endif; ?>
</div>
</section>
<section class="practicals">
<article class="pract-1 practical">
<?php the_field('practical_1');?>
</article>
<article class="pract-2 practical">
<?php the_field('practical_2');?>
</article>
<article class="pract-3 practical">
<?php the_field('practical_3');?>
<!-- <a class="cta-bttn-sml" href="<?php the_field('cta_url'); ?>"><?php the_field('cta_txt'); ?></a> -->
<?php
$cta_url = get_field('cta_url');
$cta_form = get_field('cta_form');
if( $cta_url != '' ){ ?>
<a class="cta-bttn-sml" href="<?php the_field('cta_url'); ?>"><?php the_field('cta_txt'); ?></a>
<?php } else { ?>
<?php echo $cta_form; ?>
<?php } ?>
</article>
</section>
<br class="clear">
</section>
<!-- /section -->
</main>
<?php get_footer(); ?>