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';
- $parent_terms = get_terms( $taxonomy, array( 'orderby' => 'slug', 'parent' => 0) );
- foreach( $parent_terms as $parent_term) {
- echo sprintf( '<h3 class="parent-term" id="%s">%s</h3>', $parent_term->slug, $parent_term->name);
- $child_terms = get_terms( $taxonomy, array( 'orderby' => 'slug', 'parent' => $parent_term->term_id) );
- foreach( $child_terms as $child_term) {
- $resourcequery = new WP_Query( array(
- 'post_type' => 'seo_resource',
- 'taxonomy' => $taxonomy,
- 'term' => $child_term->slug,
- 'posts_per_page' => -1
- ));
- if( $resourcequery->have_posts() ) {
- echo sprintf( '<h3 id="%s">%s</h3>', $child_term->slug, $child_term->name);
- 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
- }
- }
- }
- }
- ?>
- </div>
- </div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment