Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `<?php $this_term = get_queried_object();
- $args = array(
- 'parent' => $this_term->term_id,
- 'orderby' => 'slug',
- 'hide_empty' => true
- );
- $child_terms = get_terms( $this_term->taxonomy, $args );
- foreach ( $child_terms as $term ):
- $query = new WP_Query(
- array(
- 'post_type' => 'sfwd-courses',
- 'tax_query' => array(
- 'relation' => 'AND',
- array(
- 'taxonomy' => $this_term->taxonomy,
- 'field' => 'slug',
- 'terms' => array( $term->slug )
- )
- )
- )
- );?>
- <h3 class="child_term"><?php echo $term->name; ?></h3>
- <?php if ( $query->have_posts() ): ?>
- <ul id="focus_areas_list">
- <?php while($query->have_posts()) : $query->the_post(); ?>
- <li id="module-<?php the_ID(); ?>" class="medium-4 columns single_f_area">
- <a>">
- <div class="medium-12 columns thumb_image" style="background: url(<?php if ( has_post_thumbnail() ) { the_post_thumbnail_url(); } ?>) no-repeat center; background-size:cover;">
- <h5>
- <?php the_title(); ?>
- <?php if ( !empty( get_the_excerpt() ) ): ?>
- <span class="cat_description"><?php echo wp_trim_words( get_the_excerpt(), '10' , '...'); ?></span>
- <?php endif; ?>
- </h5>
- </div>
- <h6 class="f_area_home_title module_page">
- View Module
- </h6>
- </a>
- </li>
- <?php endwhile; ?>
- </ul>
- <?php endif; ?>
- <?php endforeach; ?>
- `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement