File: /home/awaldron/_domains/waldroninteractive.com/wp-content/themes/whoiam/frontpage.php
<?php get_header();
/*
Template name: Frontpage Template
*/
global $current_page_id;
$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;
}
$args = array( 'post_type' => 'page', 'post__in' => $test_include, 'posts_per_page' => count($test_include), 'orderby' => 'post__in', 'suppress_filters'=> true );
if( function_exists('CPTOrderPosts') )
remove_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
$main_query = new WP_Query($args);
}
else{
$args=array(
'post_type' => 'page',
'order' => 'ASC',
'orderby' => 'menu_order',
'posts_per_page' => '-1',
'suppress_filters'=> true
);
$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 ))
{
?>
<!--/*************************************************
## Contact Section
*************************************************/-->
<?php if (get_post_meta($post_id, "rnr_assign_type", true) == "contact-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin">
<?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(); } ?>
</h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="contact-area clearfix">
<?php the_content(); ?>
</div>
</section>
<!--/*************************************************
## About Section Who I Am
*************************************************/-->
<?php } else if (get_post_meta($post_id, "rnr_assign_type", true) == "about-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="clearfix my-profile">
<?php the_content(); ?>
</div>
</section>
<!--/*************************************************
## Resume Section Who I Am
*************************************************/-->
<?php } else if (get_post_meta($post_id, "rnr_assign_type", true) == "resume-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="container-medium ">
<div class="list-employment">
<ul class="list-unstyled clearfix">
<?php the_content(); ?>
</ul>
</div>
</div>
</section>
<!--/*************************************************
## Skill Section Who I Am
*************************************************/-->
<?php } else if (get_post_meta($post_id, "rnr_assign_type", true) == "skill-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="container-medium ">
<?php the_content(); ?>
</div>
</section>
<!--/*************************************************
## Parallax Section Who I Am
*************************************************/-->
<?php } else if (get_post_meta($post_id, "rnr_assign_type", true) == "parallax-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="parallax-bg black-light bg2" style="background-image:url(<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 940,550 ), false, '' ); echo $src[0]; ?>); ">
<div class="container-medium">
<div class="block-page ">
<?php the_content(); ?>
</div>
</div>
</div>
</section>
<!--/*************************************************
## Parallax Section Who I Am
*************************************************/-->
<?php } else if (get_post_meta($post_id, "rnr_assign_type", true) == "blog-section") { ?>
<section id="<?php echo $post_name; ?>" class="block-section">
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<div class="block-page">
<div class="container-medium">
<!--ERROR HERE-->
<?php the_content(); ?>
</div>
</div>
</section>
<?php } else {
if (get_post_meta($post_id, "rnr_assign_type", true) == "home-section") {
}
?>
<section id="<?php echo $post_name; ?>" class="block-section" >
<?php if((get_post_meta($post_id, "rnr_assign_type", true) != "home-section") ){ ?>
<?php if((get_post_meta( $post_id, 'rnr_disable_title', true )!= true) ){ ?>
<div class=" shape-bottom">
<div class="bg-secondary block-title">
<div class="container">
<h2 class="text-uppercase color-dark text-bold no-margin"><?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(); } ?></h2>
<?php if(get_post_meta( get_the_ID(), 'rnr_subtitle', true )){ echo '<div class="title-icon">'.get_post_meta( get_the_ID(), 'rnr_subtitle', true ).'</div>
'; } ?>
</div>
</div>
</div>
<?php } ?>
<?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") { ?>
<?php the_content(); ?>
<?php get_template_part('portfolio_section');
}
else if (get_post_meta($post_id, "rnr_assign_type", true) == "contact-section") { ?><!-- pricing section here -->
<?php get_template_part('contact_section');
}
else { ?>
<div class="container">
<?php the_content(); ?>
</div>
<?php } ?>
</section>
<?php
} ?>
<?php if($menu==1){
get_template_part('menu_section');
}
$menu=2;
}
endwhile;
endif;
wp_reset_query();
if( function_exists('CPTOrderPosts') )
add_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
function arnem_custom_scripts() {
global $smof_data;
?>
<?php }
get_footer(); ?>