-
Notifications
You must be signed in to change notification settings - Fork 1
/
frontpage.php
executable file
·143 lines (107 loc) · 4.74 KB
/
frontpage.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php get_header();
/*
Template name: Frontpage Template
*/
$current_page_id = get_option('page_on_front');
if ( ( $locations = get_nav_menu_locations() ) && $locations['main-menu'] ) {
$menu = wp_get_nav_menu_object( $locations['main-menu'] );
$menu_items = wp_get_nav_menu_items($menu->term_id);
$test_include = array();
foreach($menu_items as $item) {
if($item->object == 'page')
$test_include[] = $item->object_id;
}
if( function_exists('CPTOrderPosts') )
remove_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
$main_query = new WP_Query( array( 'post_type' => 'page', 'post__in' => $test_include, 'posts_per_page' => count($test_include), 'orderby' => 'post__in' ) );
if( function_exists('CPTOrderPosts') )
add_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
}
else{
$args=array(
'post_type' => 'page',
'order' => 'ASC',
'orderby' => 'menu_order',
'posts_per_page' => '-1'
);
$main_query = new WP_Query($args);
}
$menu = 1;
if( have_posts() ) :
while ($main_query->have_posts()) : $main_query->the_post();
global $post;
$post_name = $post->post_name;
$post_id = get_the_ID();
$separate_page = get_post_meta($post_id, "rnr_separate_page", true);
if (($separate_page!= true )&& ($post_id != $current_page_id ))
{
?>
<?php if (get_post_meta($post_id, "rnr_assign_type", true) == "parallax-section") { ?>
<!-- START PARALLAX SECTION -->
<div id="<?php echo $post_name; ?>" class="parallax">
<div id="bg<?php echo $post_id; ?>" class="parallax-bg"></div><!-- END PARALLAX BACKGROUND -->
<div class="overlay"></div><!-- END PATTERN OVERLAY -->
<div class="container clearfix">
<div class="parallax-content">
<?php the_content(); ?>
</div><!-- END PARALLAX CONTENT -->
</div><!-- END CONTAINER -->
</div>
<!-- END PARALLAX SECTION -->
<?php } else { ?>
<div id="<?php echo $post_name; ?>" class="page<?php echo $post_id; ?> section <?php if((get_post_meta($post_id, "rnr_assign_type", true) == "home-section") ){ if(($smof_data['rnr_home_type']=="Video")) { echo ' fullscreen home-video '; } else if(($smof_data['rnr_home_type']=="FullScreen Slider")) { echo ' fullscreen home-fullscreenslider '; } else { echo ' fullscreen home-parallax '; } if($smof_data['rnr_menu_style'] == "bottom"){ echo 'pagescroll'; } if($smof_data['rnr_home_look_type'] == "Regular"){ echo ' home-banner2'; }?> <?php if($smof_data['rnr_home_look_type'] == "Regular with padding"){ echo ' home-banner'; }} else { echo ' '.$post_name; }?> "><!-- SECTION -->
<?php if((get_post_meta( get_the_ID(), 'rnr_disable_title', false )!= true) && (get_post_meta($post_id, "rnr_assign_type", true) != "home-section") ){ ?>
<div class="container">
<div class="row">
<div class="sixteen columns">
<!-- START TITLE -->
<div class="title">
<h1 class="header-text"><?php if(get_post_meta( get_the_ID(), 'rnr_alt_title', true )){ echo get_post_meta( get_the_ID(), 'rnr_alt_title', true ); } else { the_title(); } ?></h1>
<div class="subtitle">
<p><?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo get_post_meta( get_the_ID(), 'rnr_subtitle', true ); } ?></p>
</div><!-- END SUBTITLE -->
</div><!-- END TITLE -->
</div><!-- END SIXTEEN COLUMNS -->
</div><!-- END ROW -->
</div><!-- END CONTAINER -->
<?php } ?>
<?php
if (get_post_meta($post_id, "rnr_assign_type", true) == "home-section") { ?>
<?php get_template_part('home_section');
}
else if (get_post_meta($post_id, "rnr_assign_type", true) == "portfolio-section") { ?>
<div class="container">
<div class="sixteen columns">
<?php the_content(); ?>
</div>
</div>
<?php get_template_part('portfolio_section');
}
else if (get_post_meta($post_id, "rnr_assign_type", true) == "contact-section") { ?>
<div class="container">
<div class="sixteen columns">
<?php the_content(); ?>
</div>
</div>
<?php get_template_part('contact_section');
}
else { ?>
<div class="container">
<div class="sixteen columns">
<?php the_content(); ?>
</div>
</div>
<?php } ?>
</div><!--END SECTION -->
<?php
} ?>
<?php if($menu==1){
get_template_part('menu_section');
}
$menu=2;
}
endwhile;
endif;
wp_reset_query();
?>
<?php get_footer(); ?>