page.php 1.86 KB
<?php
/*
 * Template Name: Broker  Pages
 */

global $user_ID;
get_currentuserinfo();
if (!$user_ID) {
    auth_redirect();
}
?>
<?php get_header("brokerlanding");
global $wpdb;
?>
<div id="brokercontent">



    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
		<div class="header-image" id="header-image" style="background-image: url(<?php echo $image[0]; ?>);">
		<div>
           <img alt="commonwell_college_logo" class="commonwell_college_logo" src="<?php echo get_stylesheet_directory_uri(); ?>/images/commonwell_college.png"/>
      </div>
    </div>
	<?php endif; ?>	

    <div id="page-content">
        <?php
            if (function_exists("clean_custom_menus")) {
                clean_custom_menus();
            }
        ?>
        <div class='inner-content-wrapper'>

            <?php 
                $sidebar_content = null;
            ?>

            <!-- CHECK IF THIS IS THE HOMEPAGE.. DISPLAY THE CONTACTS -->
            <?php if(is_front_page()) { ?>
                <?php ob_start(); include_once 'templates/broker_sidebar.php'; $sidebar_content = ob_get_clean(); ?>
            <?php } ?>

            <!-- CHECK IF THIS PAGE HAS 2nd tier menu items -->
            <?php ?>

            <!-- CHECK IF THIS PAGE HAS A SEARCH MODULE -->
            <?php ob_start(); include_once 'templates/search-sidebar.php'; $sidebar_content .= ob_get_clean(); ?>

            <?php if(!empty($sidebar_content)) { ?>
                <div class='sidebar'><?= $sidebar_content ?></div>
            <?php } ?>

            <div class='article-wrapper <?= (!empty($sidebar_content))?'has-sidebar':'' ?>'>
                <?php get_breadcrumb() ?>
                <?php get_template_part('loop', 'single');?>
            </div>

        </div>
    </div>
</div>

<?php get_footer();?>