+++ /dev/null
-<?php
-/*
-Template Name: County Landing Page Template
-*/
-get_template_part('index');
\ No newline at end of file
--- /dev/null
+<?php
+/*
+Template Name: County Page Template
+*/
+get_template_part('index');
\ No newline at end of file
+++ /dev/null
-<?php
-/*
-Template Name: County Sub Page Template
-*/
-get_template_part('index');
\ No newline at end of file
add_action('widgets_init', 'glm_quicksite_widget_init');
add_action('widgets_init', 'glm_weather_widget_init');
-define('GLM_BLOCKS_FOOTER_GROUP_ID', "8213"); // L: 8249, A: , dev70: 8213
-define('COUNTIES_PAGE_ID', "169"); // L: 8249, A: , dev70: 8213
+define('GLM_BLOCKS_FOOTER_GROUP_ID', "8249"); // L: 8249, A: , dev70: 8213
+define('COUNTIES_PAGE_ID', "169");
if (!function_exists('glm_quicksite_widget_init')) {
function get_county_page_id() {
global $post;
$countyPageId = false;
-
- if ( $post->ID == COUNTIES_PAGE_ID ) {
- // I'm the counties page
- } else if ( wp_get_post_parent_id( $post ) == COUNTIES_PAGE_ID ) {
- // I'm a county page
- $countyPageId = $post->ID;
- } else {
- // I'm a child of a county page
- $countyPageId = wp_get_post_parent_id( $post );
+ if ( is_in_tree( COUNTIES_PAGE_ID ) ) {
+ if ( $post->ID == COUNTIES_PAGE_ID ) {
+ // I'm the counties page
+ } else if ( wp_get_post_parent_id( $post ) == COUNTIES_PAGE_ID ) {
+ // I'm a county page
+ $countyPageId = $post->ID;
+ } else {
+ // I'm a child of a county page
+ $countyPageId = wp_get_post_parent_id( $post );
+ }
}
return $countyPageId;
+++ /dev/null
-<?php
-/*
-Template Name: Landing Page
-*/
-get_template_part('index');
\ No newline at end of file
?>
<main class="page-inside <?php echo $template ?: 'default-template';?>>
<?php if ( is_in_tree( COUNTIES_PAGE_ID ) ) { ?>
- <?php if ( $post->ID == COUNTIES_PAGE_ID ) { ?>
- <?php
- // I'm the counties page
- // $debugMsg[] = "I'm the counties page";
- $isCountiesPage = true;
- ?>
- <?php } else if ( wp_get_post_parent_id( $post ) == COUNTIES_PAGE_ID ) { ?>
- <?php
- // I'm a county page
- // $debugMsg[] = "I'm a county page";
- $isCountyLandingPage = true;
- $countyPageId = $post->ID;
- ?>
- <?php } else { ?>
- <?php
- // I'm a child of a county page
- // $debugMsg[] = "I'm a child of a county page";
- $isCountyChildPage = true;
- $countyPageId = wp_get_post_parent_id( $post );
- $debugMsg[] = "post: " . get_the_title($post->ID);
- ?>
- <?php } ?>
-
+
<?php
$countyPageId = get_county_page_id();
$countyChildren = get_county_page_children($countyPageId);
<?php if ( $countyChildren ) {
if(strpos(get_the_title($post->ID), 'Water') !== false ){
// $debugMsg[] = "I'm a waterfall page";
- $memberCategory = '25'; // L: 3, dev70: 25
+ $memberCategory = '3'; // L: 3, dev70: 25
} else if(strpos(get_the_title($post->ID), 'Light') !== false ){
// $debugMsg[] = "I'm a lighthouse page";
- $memberCategory = '21'; // L: 4, ddev70: 21
+ $memberCategory = '4'; // L: 4, ddev70: 21
} else {
// $debugMsg[] = "I'm neither waterfall nor a light house";
}
?>
- <?php if ( $post->ID == COUNTIES_PAGE_ID ) { ?>
+ <?php if ( $post->ID == COUNTIES_PAGE_ID && ( function_exists('the_field') && get_field('interior_header_crowdriff_script',$post->ID) )) { ?>
+ <div id="header-crowdriff">
+ <?php echo the_field('interior_header_crowdriff_script',$post->ID); ?>
+ </div>
+ <?php } else if (function_exists('the_field') && get_field('interior_header_crowdriff_script',$post->ID)) { ?>
<div id="header-crowdriff">
<?php echo the_field('interior_header_crowdriff_script',$post->ID); ?>
</div>
echo do_shortcode("[glm-members-list show='-list' view='map' category='". $memberCategory ."' county-search='". $memberCountyId ."']");
?>
</div>
- <?php } else if (function_exists('the_field') && get_field('interior_header_crowdriff_script',$post->ID)) { ?>
- <div id="header-crowdriff">
- <?php echo the_field('interior_header_crowdriff_script',$post->ID); ?>
- </div>
- <?php } else { ?>
+ <?php } else { ?>
<div id="header-featured">
<?php echo glm_get_header(); ?>
</div>
</div>
<?php break; ?>
- <?php case "county-landing-page-template": ?>
- <div class="row">
- <div class="small-12 large-8 columns" data-equalizer-watch>
- <?php echo the_field('top_content',$post->ID); ?>
- <?php echo the_field('member_db_map_shortcode',$post->ID); ?>
- <?php echo the_field('member_db_list_shortcode',$post->ID); ?>
- <?php get_template_part('parts/main-content'); ?>
- </div>
- <div class="small-12 large-4 columns">
- <?php get_sidebar(); ?>
- </div>
- </div>
- <?php break; ?>
-
- <?php case "county-sub-page-template": ?>
- <div class="row">
- <div class="small-12 large-8 columns" data-equalizer-watch>
- <?php //echo the_field('top_content',$post->ID); ?>
- <?php //echo the_field('member_db_map_shortcode',$post->ID); ?>
- <?php //echo the_field('member_db_list_shortcode',$post->ID); ?>
- <?php get_template_part('parts/main-content'); ?>
- </div>
- <div class="small-12 large-4 columns">
- <?php get_sidebar(); ?>
- </div>
- </div>
- <?php break; ?>
-
<?php default: ?>
<div class="row">
- <div class="small-12 large-8 columns">
+ <div class="small-12 large-8 columns" data-equalizer-watch>
<?php get_template_part('parts/main-content'); ?>
</div>
<div class="small-12 large-4 columns">
<div id="sidebar" class="show-for-large-up large-4 columns">
- <?php
- $countyPageId = get_county_page_id();
- $countyChildren = get_county_page_children($countyPageId);
- ?>
- <?php if ( $countyChildren ) { ?>
+ <?php if ( is_in_tree( COUNTIES_PAGE_ID ) ) { ?>
+ <?php
+ $countyPageId = get_county_page_id();
+ $countyChildren = get_county_page_children($countyPageId);
+ ?>
+ <?php if ( $countyChildren ) { ?>
- <div id="county-buttons-container" class="row" >
- <h2>Explore</h2>
- <div id="county-buttons">
-
- <div class="image-strip" >
- <a class="county-button active" href="<?php echo get_permalink( $countyPageId ); ?>#about">
- <i class="fas fa-info-circle about-icon"></i>
- About
- </a>
- </div>
- <div class="image-strip">
- <a class="county-button active" href="<?php echo get_permalink( $countyPageId ); ?>#gallery">
- <i class="fas fa-images about-icon"></i>
- Gallery
- </a>
- </div>
- <?php foreach ( $countyChildren as $countyChild ) { ?>
- <?php if(strpos($countyChild['post_title'], 'Water') !== false ){
- $icon = 'fa-water';
- }else if(strpos($countyChild['post_title'], 'Light') !== false ){
- $icon = 'lighthouse';
- } ?>
- <div class="image-strip <?php if ($post->ID == $countyChild['ID']) { ?>active<?php } ?>">
- <a class="county-button" href="<?php echo get_permalink( $countyChild["ID"] );?>">
- <i class="fas <?php echo $icon; ?> <?php echo $icon .'-icon'; ?>"></i>
- <?php echo $countyChild['post_title']; ?>
+ <div id="county-buttons-container" class="row" >
+ <h2>Explore</h2>
+ <div id="county-buttons">
+
+ <div class="image-strip" >
+ <a class="county-button active" href="<?php echo get_permalink( $countyPageId ); ?>#about">
+ <i class="fas fa-info-circle about-icon"></i>
+ About
</a>
</div>
- <?php } ?>
+ <div class="image-strip">
+ <a class="county-button active" href="<?php echo get_permalink( $countyPageId ); ?>#gallery">
+ <i class="fas fa-images about-icon"></i>
+ Gallery
+ </a>
+ </div>
+ <?php foreach ( $countyChildren as $countyChild ) { ?>
+ <?php if(strpos($countyChild['post_title'], 'Water') !== false ){
+ $icon = 'fa-water';
+ }else if(strpos($countyChild['post_title'], 'Light') !== false ){
+ $icon = 'lighthouse';
+ } ?>
+ <div class="image-strip <?php if ($post->ID == $countyChild['ID']) { ?>active<?php } ?>">
+ <a class="county-button" href="<?php echo get_permalink( $countyChild["ID"] );?>">
+ <i class="fas <?php echo $icon; ?> <?php echo $icon .'-icon'; ?>"></i>
+ <?php echo $countyChild['post_title']; ?>
+ </a>
+ </div>
+ <?php } ?>
+ </div>
</div>
- </div>
+ <?php } ?>
<?php } ?>
<?php
if (is_in_tree(get_option('glm_members_database_option_members_only_id'))) {?>