} else if ( get_entity_template() ) {
$GLOBALS['entity_page_slug'] = get_entity_template();
} else {
- $GLOBALS['entity_page_slug'] = 'default';
+ if (has_tag('government', $post)) {
+ $GLOBALS['entity_page_slug'] = 'government';
+ } else if (has_tag('chamber-of-commerce', $post)) {
+ $GLOBALS['entity_page_slug'] = 'chamber-of-commerce';
+ } else if (has_tag('edc', $post)) {
+ $GLOBALS['entity_page_slug'] = 'edc';
+ } else if (has_tag('convention-visitors-bureau', $post)) {
+ $GLOBALS['entity_page_slug'] = 'convention-visitors-bureau';
+ } else {
+ $GLOBALS['entity_page_slug'] = 'default';
+ }
}
// get_entity_template returns current page slug if current page is entity page
// returns parent entity page slug if child of entity page
// returns false if top-level non-entity
- ?>
+ ?>
<body class="<?php echo $GLOBALS['entity_page_slug'] ?>-entity">
<div class="off-canvas-wrapper">
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
include "sections/front-page.php";
} else {
include "sections/header.php";
- if (is_home()) {
+ if (is_home() || is_page($GLOBALS['entity_page_slug']."-news")) {
include "sections/blog-home.php";
- }
- if (is_archive()) {
+ } else if (is_archive()) {
include "sections/blog-archive.php";
- }
- if (is_single()) {
+ } else if (is_single()) {
include "sections/blog-single.php";
- }
- if (is_search()) {
+ } else if (is_search()) {
include "sections/search.php";
- }
- if (is_page() && !is_front_page()) {
+ } else if (is_page() && !is_front_page()) {
if(is_entity_landing_page()) {
include __DIR__.'/sections/entity-landing.php';
} else {
<div id="blog-posts-over" class="small-12 medium-9 columns">
- <?php if(have_posts()) : while(have_posts()): the_post();?>
+ <?php $tag_query = new WP_Query( 'tag='.$GLOBALS['entity_page_slug'] ); ?>
+ <?php echo $GLOBALS['entity_page_slug']; ?>
+ <?php if($tag_query->have_posts()) : while($tag_query->have_posts()): $tag_query->the_post();?>
<div class="row content blog-posts-container">
<!-- <div class="small-11 small-centered columns"> -->
<?php $thumbnail = get_the_post_thumbnail($post->ID, 'blog-feed-front'); ?>
<article id="<?php the_ID()?>" <?php post_class()?>>
<header class="entry-header">
- <h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h1>
+ <h1 class="entry-title"><a href="<?php the_permalink(); ?>?entity_template=<?php echo $GLOBALS['entity_page_slug'];?>"><?php the_title();?></a></h1>
<?php if ( has_post_thumbnail() ):?>
- <?php if (get_post_type( $post ) != "ai1ec_event") { ?>
- <div class="featured-image-wrap"><?php the_post_thumbnail("large"); ?></div>
- <?php } ?>
+ <?php if (get_post_type( $post ) != "ai1ec_event") { ?>
+ <div class="featured-image-wrap"><?php the_post_thumbnail("large"); ?></div>
+ <?php } ?>
<?php endif; ?>
<span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
<?php get_template_part('parts/share-this'); ?>
</header>
-
+
<?php echo the_content(); ?>
</article>
\ No newline at end of file
-<?php
-switch ($GLOBALS['entity_page_slug']) {
- case 'government':
- $sidebar_class = 'government';
- break;
- case 'chamber-of-commerce':
- $sidebar_class = 'chamber';
- break;
- case 'convention-visitors-bureau':
- $sidebar_class = 'cvb';
- break;
- case 'edc':
- $sidebar_class = 'default';
- break;
- default:
- break;
-} ?>
<div class="row opensearchserver.ignore">
<div class="small-12 columns text-center medium-text-left">
<div class="sidebar-share small-12 columns show-for-large-up">