Updating the index page to handle the employment plugin
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Jan 2016 16:38:44 +0000 (11:38 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 12 Jan 2016 16:38:44 +0000 (11:38 -0500)
index.php

index cf2d12c..4e15961 100644 (file)
--- a/index.php
+++ b/index.php
                 </div>
             </div>
             <div class="row">
-                <?php if(!(is_page(2670))) { ?>
+                <?php
+                $isEmploymentAppPage = false;
+                if (shortcode_exists('glmjobs')) {
+                    $isEmploymentAppPage = true;
+                    $applyOnline = (isset($_REQUEST['applyOnline']))
+                        ? filter_var($_REQUEST['applyOnline'], FILTER_VALIDATE_INT)
+                        : false;
+                    $job = (isset($_REQUEST['job']))
+                        ? filter_var($_REQUEST['job'], FILTER_VALIDATE_INT)
+                        : false;
+                    $search = (isset($_REQUEST['glm_job_search']))
+                        ? filter_var($_REQUEST['glm_job_search'], FILTER_VALIDATE_BOOLEAN)
+                        : false;
+                }
+                ?>
+                <?php if( !(is_page(2670)) && !$isEmploymentAppPage ) { ?>
                 <div id="main-content" class="small-12 large-8 columns right">
-                        <?php if(have_posts()) : while(have_posts()): the_post();?>
-                        <?php the_content();?>
-                        <?php endwhile; else:?>
-                        <p><?php _e('Sorry, no results found.');?></p>
-                        <?php endif;?>
+                            <?php if(have_posts()) : while(have_posts()): the_post();?>
+                            <?php the_content();?>
+                            <?php endwhile; else:?>
+                            <p><?php _e('Sorry, no results found.');?></p>
+                            <?php endif;?>
                 </div>
-              
                 <div class="side-links Large-4 show-for-large-up columns">
                     <?php get_sidebar(); ?>
                 </div>
                 <?php } else { ?>
                 <div id="main-content" class="small-12 large-12 columns">
-                    <?php if(have_posts()) : while(have_posts()): the_post();?>
-                    <?php the_content();?>
-                    <?php endwhile; else:?>
-                    <p><?php _e('Sorry, no results found.');?></p>
+                    <?php if (!$search && !$job && !$applyOnline):?>
+                        <?php if(have_posts()) : while(have_posts()): the_post();?>
+                        <?php the_content();?>
+                        <?php endwhile; else:?>
+                        <p><?php _e('Sorry, no results found.');?></p>
+                        <?php endif;?>
+                    <?php else:?>
+                        <?php if (shortcode_exists('glmjobs')) {echo do_shortcode('[glmjobs]');}?>
                     <?php endif;?>
                 </div>
                 <?php } ?>
-<!--
-                <div class="small-12 medium-6 large-4 columns small-text-center medium-text-left">
-                    
-                </div>
--->
             </div>
         </div>
-        
 <?php get_footer(); ?>