Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Trustees
- */
- ?>
- <?php get_header(); ?>
- <h2>Directores - USA</h2>
- <?php // separate loop
- $Directores_usa = new WP_Query();
- $Directores_usa->query( array(
- 'posts_per_page' => -1, // number of posts to retrieve, -1 pulls all posts
- 'order' => 'ASC', // ascending order, default ordering by date
- 'post_type' => 'Directores', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'Location', // taxonomy slug
- 'field' => 'slug', // term field to match agains
- 'terms' => 'usa' // actual term
- )
- )
- )
- );
- // loop
- if ( $Directores_usa->have_posts() ) : ?>
- <?php while ( $Directores_usa->have_posts() ) : $Directores_usa->the_post(); ?>
- <?php /* To avoid code repetition, let's move the part for displaying the post into another template file
- this will load a file called loop-trustees.php in the theme root; if it doesn't exist loop.php would be loaded instead
- */
- get_template_part( 'loop', 'trustees' ); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <h2>Directores - Europe</h2>
- <?php // separate loop
- $Directores_europe = new WP_Query();
- $Directores_europe->query( array(
- 'posts_per_page' => -1, // number of posts to retrieve, -1 pulls all posts
- 'order' => 'ASC', // ascending order, default ordering by date
- 'post_type' => 'Directores', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'Location', // taxonomy slug
- 'field' => 'slug', // term field to match agains
- 'terms' => 'europe' // actual term
- )
- )
- )
- );
- if ( $Directores_europe->have_posts() ) : ?>
- <?php while ( $Directores_europe->have_posts() ) : $Directores_europe->the_post(); ?>
- <?php get_template_part( 'loop', 'trustees' ); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <h2>Staff</h2>
- <?php // separate loop
- $staff = new WP_Query();
- $staff->query( array(
- 'posts_per_page' => -1, // number of posts to retrieve, -1 pulls all posts
- 'order' => 'ASC', // ascending order, default order by date
- 'post_type' => 'Staff', // custom post type slug
- 'tax_query' => array(
- array(
- 'taxonomy' => 'Trustee', // taxonomy slug
- 'field' => 'slug', // term field to match agains
- 'terms' => 'yes' // actual term
- )
- )
- )
- );
- if ( $staff->have_posts() ) : ?>
- <?php while ( $staff->have_posts() ) : $staff->the_post(); ?>
- <?php get_template_part( 'loop', 'trustees' ); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment