Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Trustees' Posts
- */
- ?>
- <?php get_header(); ?>
- <h2>Directors - USA</h2>
- <?php // separate loop
- $directors_usa = new WP_Query();
- $directors_usa->query( array(
- 'posts_per_page' => 4, // number of posts to retrieve
- 'post_type' => 'directors', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'location', // taxonomy
- 'field' => 'slug', // term field to match agains
- 'terms' => 'usa' // actual term
- )
- )
- )
- );
- // loop
- if ($directors_usa->have_posts()) : ?>
- <?php while ($directors_usa->have_posts()) : $directors_usa->the_post(); ?>
- <div <?php post_class(); ?>>
- <?php // post thumbnail
- if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
- the_post_thumbnail();
- } ?>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
- <?php echo get_the_term_list( $post->ID, 'position', 'Position: ', ' ', '' ); ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <h2>Directors - Europe</h2>
- <?php // separate loop
- $directors_europe = new WP_Query();
- $directors_europe->query( array(
- 'posts_per_page' => 4, // number of posts to retrieve
- 'post_type' => 'directors', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'location', // taxonomy
- 'field' => 'slug', // term field to match agains
- 'terms' => 'europe' // actual term
- )
- )
- );
- if ($directors_europe->have_posts()) : ?>
- <?php while ($directors_europe->have_posts()) : $directors_europe->the_post(); ?>
- <div <?php post_class(); ?>>
- <?php // post thumbnail
- if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
- the_post_thumbnail();
- } ?>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
- <?php echo get_the_term_list( $post->ID, 'position', 'Position: ', ' ', '' ); ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <h2>Staff</h2>
- <?php // separate loop
- $staff = new WP_Query();
- $staff->query( array(
- 'posts_per_page' => 4, // number of posts to retrieve
- 'post_type' => 'staff', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'trustee', // taxonomy
- 'field' => 'slug', // term field to match agains
- 'terms' => 'yes' // actual term
- )
- )
- );
- if ($staff->have_posts()) : ?>
- <?php while ($staff->have_posts()) : $staff->the_post(); ?>
- <div <?php post_class(); ?>>
- <?php // post thumbnail
- if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
- the_post_thumbnail();
- } ?>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
- <?php echo get_the_term_list( $post->ID, 'position', 'Position: ', ' ', '' ); ?>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment