Advertisement
Guest User

Untitled

a guest
Aug 21st, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.55 KB | None | 0 0
  1. <?php
  2. /*
  3.  * Monolith
  4.  * WordPress Taxonomy Page
  5.  * This page is the main archive for taxonomy terms. The loop is ran when the taxonomy term is queried via URL.
  6. */
  7. ?>
  8. <? $thisvar = get_query_var( 'taxonomy' );?>
  9. <? $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );?>
  10. <? $thatvar = $term->slug;?>
  11. <? $anothervar = get_post_type();?>
  12.  
  13. <?php get_template_parts( array( 'parts/html-header', 'parts/header' ) ); ?>
  14.  
  15. <div class="wrapper-main" role="main">
  16.  
  17.     <div class="<?= CONTAINER_CLASSES; ?>">
  18.    
  19.         <? get_template_part('parts/breadcrumb'); // load breadcrumb ?>
  20.    
  21.         <div class="<?= ROW_CLASSES ?>">
  22.  
  23.             <div class="<?= MAIN_SIZE ?>">
  24.  
  25.                 <header class="page-header archive-header" itemprop="name">
  26.                 <?echo $anothervar?>
  27.                     <h1 class="archive-title h1">
  28.                         <?php echo single_term_title(); ?><?php if ( is_post_type_archive() ) { ?> <?php $obj = get_post_type_object( $anothervar );echo $obj->labels->name;?><?}?> <?php if ( !is_post_type_archive() ) { ?>Overview<?}?>
  29.                     </h1>
  30.                
  31.                 </header>
  32.  
  33.             <?php if ( is_post_type_archive() ) { //this runs when a custom post type is viewed ex: ?post_type=articles?>
  34.            
  35.  
  36.             <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  37.                 <? // markup for post snippet, used in loops and queries ?>
  38.                 <article  itemscope itemtype="http://schema.org/Article" <?php post_class(); ?>>
  39.                
  40.                
  41.  
  42.                     <? if (has_post_thumbnail()) { ?><div class="thumbnail previewimg alignleft"><a href="<? the_permalink();?>"><? the_post_thumbnail( array(100,100) );?></a></div><?}?>
  43.                    
  44.                     <header class="snippet-title">
  45.                         <h2 class="snippet-headline" itemprop="name"><a href="<?= get_permalink() ?>" title="<?php the_title(); ?>" class="post-permalink" itemprop="url"><?php the_title(); ?></a></h2>
  46.                     </header>
  47.                    
  48.                     <section class="snippet-excerpt">
  49.                         <p itemprop="description"><?= get_the_excerpt(); ?></p>
  50.                     </section> 
  51.                    
  52.                     <footer class="snippet-footer clearfix">
  53.                         <?php get_template_part('parts/meta/readmore'); ?>
  54.                     </footer> <!-- end article footer -->
  55.  
  56.                 </article>
  57.                 <hr/>
  58.             <?php endwhile; ?>
  59.  
  60.             <? elseif ( is_search() ) : // display an error if no search results are found ?>
  61.                 <div class="alert">No results found for '<?php echo get_search_query(); ?>'</div>
  62.             <? else : ?>
  63.                 <div class="alert">There are no posts to display.</div>
  64.             <?php endif; ?>
  65.  
  66.             <?php get_template_part('parts/pagination') // load the pagination part ?>
  67.             <?} else {?>
  68.  
  69.             <div class="well well-small">
  70.                 <h3><?php echo single_term_title(); ?> Articles</h3>
  71.                 <?php query_posts(array('post_type' => 'article',$thisvar => $thatvar,'showposts' => 1 ) ); ?>
  72.                 <? if ( have_posts() ) : while ( have_posts() ) : the_post();?>
  73.                 <h4><a href="<? the_permalink();?>"><?php the_title(); ?></a></h4>
  74.                 <?php the_excerpt(); ?>
  75.                 <div class="navigation"><a href="?post_type=article">View all <?php echo single_term_title(); ?> Articles</a></div>
  76.                 <?php endwhile; else: ?>
  77.                 <p>No <? echo single_term_title(); ?> articles found.</p>
  78.                 <? endif; wp_reset_query(); ?>
  79.             </div>
  80.            
  81.             <div class="well well-small">
  82.                 <h3><?php echo single_term_title(); ?> Businesses</h3>
  83.                 <?php query_posts(array('post_type' => 'location',$thisvar => $thatvar,'showposts' => 10 ) ); ?>
  84.                 <? if ( have_posts() ) : while ( have_posts() ) : the_post();?>
  85.                 <h4><a href="<? the_permalink();?>"><?php the_title(); ?></a></h4>
  86.                 <?php the_excerpt(); ?>
  87.                 <?php endwhile; else: ?>
  88.                 <p>No Businesses listed for <? echo single_term_title(); ?> at this time.</p>
  89.                 <? endif; wp_reset_query(); ?>
  90.             </div>
  91.            
  92.             <div class="well well-small">
  93.                 <h3><?php echo single_term_title(); ?> Events</h3>
  94.                 <?php query_posts(array('post_type' => 'event',$thisvar => $thatvar,'showposts' => 10 ) ); ?>
  95.                 <? if ( have_posts() ) : while ( have_posts() ) : the_post();?>
  96.                 <h4><a href="<? the_permalink();?>"><?php the_title(); ?></a></h4>
  97.                 <?php the_excerpt(); ?>
  98.                 <?php endwhile; else: ?>
  99.                 <p>No Events listed for <? echo single_term_title(); ?> at this time.</p>
  100.                 <? endif; wp_reset_query(); ?>
  101.             </div>
  102.             <?php } ?>
  103.  
  104.             </div><!-- MAIN_SIZE -->
  105.  
  106.             <aside class="sidebar-right <?= SIDEBAR_SIZE?>" role="complementary">
  107.                 <section class="sidebar widget template-widget">
  108.                
  109.                     <h3><?php echo single_term_title(); ?> Species</h3>
  110.                     <?php query_posts(array('post_type' => 'species',$thisvar => $thatvar,'showposts' => 10 ) ); ?>
  111.                     <? if ( have_posts() ) : while ( have_posts() ) : the_post();?>
  112.                     <div class="specie">
  113.                         <a class="thumbnail alignleft" href="<? the_permalink();?>"><? the_post_thumbnail("squared");?></a>
  114.                         <h4 class="clearfix"><a href="<? the_permalink();?>"><?php the_title(); ?></a></h4>
  115.                     </div>
  116.                     <?php endwhile;?>
  117.                     <a href="/<? echo $thisvar ?>/<? echo $thatvar ?>?post_type=species">View all <? echo single_term_title(); ?> Species</a>
  118.                     <?else: ?>
  119.                     <div class="specie">
  120.                         <p>No species listed for <? echo single_term_title(); ?>.</p>
  121.                     </div>
  122.                     <? endif; wp_reset_query(); ?>
  123.                 </section>
  124.                 <section class="widget widget-template">
  125.                     <h3><? echo single_term_title(); ?> Locations</h3>
  126.                     <div class="map"><?php echo do_shortcode('[mashup query="'.$thisvar.'='.$thatvar.'&posts_per_page=-1" width="100%" height="300" adaptive="true"]'); ?></div>
  127.                 </section>
  128.             </aside>
  129.  
  130.         </div><!-- /ROW_CLASSES -->
  131.  
  132.     </div><!-- /CONTAINER_CLASSES -->
  133.  
  134. </div><!-- /main -->   
  135.  
  136. <?php get_template_parts( array( 'parts/footer','parts/html-footer' ) ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement