Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="boxed-in">
- <?php get_template_part('templates/page', 'header'); ?>
- <div class="row-fluid">
- <div class="span3 resourcemenu">
- <?php
- $args = array(
- 'taxonomy' => 'seo_resource_topics',
- 'hierarchical' => true
- );
- $terms = get_terms('seo_resource_topics', $args);
- $count = count($terms);
- if ( $count > 0 ){
- echo "<ul>";
- foreach ( $terms as $term ) {
- $class= ($term->parent == 0) ? " parent-term" : "";
- echo "<li><a class=\"scroll".$class."\" href=#" . $term->slug . ">" . $term->name . "</a></li>";
- }
- echo "</ul>";
- }
- ?>
- </div>
- <div class="span9">
- <div class="resourcearchive padded">
- <?php
- $taxonomy = 'seo_resource_topics';
- // Gets every "category" (term) in this taxonomy to get the respective posts
- $terms = get_terms( $taxonomy );
- foreach( $terms as $term ) :
- $class= ($term->parent == 0) ? " class=\"parent-term\"" : "";
- echo '<h3 '.$class.'id="' . $term->slug . '">'. $term->name. '</h3>';
- if ( $term->parent == 0 ) continue;
- $resourcequery = new WP_Query(array(
- 'post_type' => 'seo_resource',
- 'taxonomy' => $taxonomy,
- 'term' => $term->slug,
- 'posts_per_page' => -1
- ));
- if( $resourcequery->have_posts() ): while( $resourcequery->have_posts() ) : $resourcequery->the_post(); ?>
- <article <?php post_class(); ?>>
- <header>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- </header>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- </div>
- </article>
- <?php endwhile; ?>
- <?php endif;
- endforeach;
- ?>
- </div>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment