-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-enterprise.php
113 lines (71 loc) · 4.13 KB
/
page-enterprise.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
<?php
/*
* Template Name: Page Enterprise
* Description: Template for Enterprise Page with three columns
*/
?>
<?php get_header(); ?>
<div class="custom-container">
<!--Section with customized large banner image-->
<?php $one = get_theme_mod('page-layout-display');?>
<!--If user wants to display Image-->
<?php if ( $one == 'Yes') { ?>
<section class="page-layout-image banner">
<div class="container">
<!-- <h1><?php echo get_theme_mod('front-page-layout-heading'); ?>
</h1>-->
<h1 class="page-title-white">
<?php $title = get_the_title(); echo esc_html($title); ?>
</h1>
</div>
</section>
<?php } ?>
<?php if ( $one == 'No') { ?>
<section class="page-layout-none">
<h1 class="page-title-white small">
<?php $title = get_the_title(); echo esc_html($title); ?>
</h1>
</section>
<?php } ?>
<!--Section for pages with 2 columns-->
<section class="two-columns">
<?php $args = array(
'post_type' => 'enterprise-posts',
'posts_per_page' => -1
);
$loop = new WP_Query( $args );
if( $loop->have_posts()) :
$i = 1;
while( $loop->have_posts()) : $loop->the_post(); ?>
<div class="enterprise-parent ">
<?php if ($i % 2 == 1) { //variabeln /2 ska INTE gå jämnt upp ?>
<div class="enterprise-text text" >
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
</div>
<div class="aside-box" >
<?php get_template_part('parts/aside-box-section'); ?>
</div>
<?php } ?>
<?php if ($i % 2 == 0) { ?>
<div class="enterprise-text text" >
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
</div> <!--/ >-->
<div class="enterprise-text image" >
<?php the_post_thumbnail('normal-thumbnail'); ?>
</div> <!--/. >-->
<?php } ?>
</div> <!--enterprise-parent-->
<?php $i++;
endwhile;
else : ?>
<p><?php __('No Post Found'); ?></p>
<?php endif;
//now wp is the boss again
wp_reset_postdata();
?>
<?php get_template_part('parts/pdf-section'); ?>
</section>
</div><!-- /.custom-container -->
<?php get_footer(); ?>