Newer
Older
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
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package accesspress_parallax
*/
$sections = of_get_option('parallax_section');
if(!empty($sections)):
foreach ($sections as $section) :
$page = get_post( $section['page'] );
$overlay = $section['overlay'];
$image = $section['image'];
$layout = $section['layout'];
$category = $section['category'];
$googlemapclass = $layout == "googlemap_template" ? " google-map" : "";
?>
<?php if(!empty($section['page'])): ?>
<section class="parallax-section clearfix<?php echo esc_attr($googlemapclass)." ".esc_attr($layout); ?>" id="<?php echo "section-".absint($page->ID); ?>">
<?php if(!empty($image) && $overlay != "overlay0") : ?>
<div class="overlay"></div>
<?php endif; ?>
<?php if($layout != "googlemap_template") :?>
<div class="mid-content">
<?php endif; ?>
<?php
$query = new WP_Query( 'page_id='.$section['page'] );
while ( $query->have_posts() ) : $query->the_post();
?>
<?php
if($layout != "action_template" && $layout != "blank_template" && $layout != "googlemap_template"): ?>
<h1><span><?php the_title(); ?></span></h1>
<div class="parallax-content">
<?php if(get_the_content() != "") : ?>
<div class="page-content">
<?php the_content(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php
endwhile;
?>
<?php
switch ($layout) {
case 'default_template':
$template = "layouts/default";
break;
case 'service_template':
$template = "layouts/service";
break;
case 'team_template':
$template = "layouts/team";
break;
case 'portfolio_template':
$template = "layouts/portfolio";
break;
case 'testimonial_template':
$template = "layouts/testimonial";
break;
case 'action_template':
$template = "layouts/action";
break;
case 'blank_template':
$template = "layouts/blank";
break;
case 'googlemap_template':
$template = "layouts/googlemap";
break;
case 'blog_template':
$template = "layouts/blog";
break;
default:
$template = "layouts/default";
break;
}
?>
<?php include(locate_template($template."-section.php"));?>
<?php if($layout != "googlemap_template") :?>
</div>
<?php endif; ?>
</section>
<?php
endif;
endforeach;
else:
get_template_part('demo');
endif;