Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php switch_to_blog(2); //boston offices ?>
- <?php
- // WP_Query arguments
- $args = array (
- 'post_type' => 'office',
- 'pagination' => false,
- 'posts_per_page' => '-1',
- 'order' => 'ASC',
- 'orderby' => 'title',
- );
- // The Query
- $office2 = new WP_Query( $args ); ?>
- <?php if ($office2->have_posts()): ?>
- <?php while ($office2->have_posts()) : $office2->the_post(); ?>
- <li class="text--center grid__item one-quarter s-one-whole xs-one-whole space all-cities all-neighborhoods all-types
- <?php $getslugid = wp_get_post_terms( $post->ID, 'space-type' );
- foreach( $getslugid as $thisslug ) {
- echo ' ' . $thisslug->slug . ' ';
- }
- ?>
- <?php $posts = get_field('neighborhood_name'); if( $posts ): ?>
- <?php foreach( $posts as $p): // variable must be called $post (IMPORTANT) ?>
- <?php echo get_the_slug( $p->ID ); ?>
- <?php endforeach; ?>
- <?php endif; ?>
- <?php print strtolower(get_bloginfo('name')); ?>
- ">
- <?php
- $count = 0;
- if( have_rows('space_images') ): ?>
- <?php while( have_rows('space_images') ): the_row();
- $count++;
- $image = get_sub_field('space_image');
- ?>
- <?php if ($count == 1) { // grab the first image?>
- <a href="<?php the_field('space_neighborhood_parent'); ?>#<?php the_field('office_url_hash'); ?>">
- <img src="<?php echo $image; ?>">
- </a>
- <?php } else { // nothing -- we only want the first image to display?>
- <?php } ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <hgroup>
- <?php $posts = get_field('neighborhood_name'); if( $posts ): ?>
- <?php foreach( $posts as $p): // variable must be called $post (IMPORTANT) ?>
- <h6 class="hN"><?php echo get_the_title( $p->ID ); ?></h6>
- <?php endforeach; ?>
- <?php endif; ?>
- <h5 class="hN">
- <a href="<?php the_field('space_neighborhood_parent'); ?>#<?php the_field('office_url_hash'); ?>">
- <?php the_title(); ?>
- </a>
- </h5>
- <p class="hN"><?php the_field('office_address'); ?></p>
- <p class="hN">
- <?php if( has_term( 'coworking-space', 'space-type', $post->ID ) ) { ?>
- <i class="fa fa-lg coworking-space"></i> Coworking Space
- <?php } ?>
- <?php if( has_term( 'shared-office-space', 'space-type', $post->ID ) ) { ?>
- <i class="fa fa-lg shared-office-space"></i> Shared Office Space
- <?php } ?>
- </p>
- </hgroup>
- </li><!--/.room-->
- <?php endwhile; ?>
- <?php wp_reset_postdata(); ?>
- <?php endif; // end loop?>
- <?php restore_current_blog(); ?>
- <?php switch_to_blog(3); //beyond boston offices?>
- <?php
- // WP_Query arguments
- $args = array (
- 'post_type' => 'office',
- 'pagination' => false,
- 'posts_per_page' => '-1',
- 'order' => 'ASC',
- 'orderby' => 'title',
- );
- // The Query
- $office3 = new WP_Query( $args ); ?>
- <?php if ($office3->have_posts()): ?>
- <?php while ($office3->have_posts()) : $office3->the_post(); ?>
- <li class="text--center grid__item one-quarter s-one-whole xs-one-whole space all-cities all-neighborhoods all-types
- <?php $getslugid = wp_get_post_terms( $post->ID, 'space-type' );
- foreach( $getslugid as $thisslug ) {
- echo ' ' . $thisslug->slug . ' ';
- }
- ?>
- <?php $posts = get_field('neighborhood_name'); if( $posts ): ?>
- <?php foreach( $posts as $p): // variable must be called $post (IMPORTANT) ?>
- <?php echo get_the_slug( $p->ID ); ?>
- <?php endforeach; ?>
- <?php endif; ?>
- <?php print strtolower(get_bloginfo('name')); ?>
- ">
- <?php
- $count = 0;
- if( have_rows('space_images') ): ?>
- <?php while( have_rows('space_images') ): the_row();
- $count++;
- $image = get_sub_field('space_image');
- ?>
- <?php if ($count == 1) { // grab the first image?>
- <a href="<?php the_field('space_neighborhood_parent'); ?>#<?php the_field('office_url_hash'); ?>">
- <img src="<?php echo $image; ?>">
- </a>
- <?php } else { // nothing -- we only want the first image to display?>
- <?php } ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <hgroup>
- <?php $posts = get_field('neighborhood_name'); if( $posts ): ?>
- <?php foreach( $posts as $p): // variable must be called $post (IMPORTANT) ?>
- <h6 class="hN"><?php echo get_the_title( $p->ID ); ?></h6>
- <?php endforeach; ?>
- <?php endif; ?>
- <h5 class="hN">
- <a href="<?php the_field('space_neighborhood_parent'); ?>#<?php the_field('office_url_hash'); ?>">
- <?php the_title(); ?>
- </a>
- </h5>
- <p class="hN"><?php the_field('office_address'); ?></p>
- <p class="hN">
- <?php if( has_term( 'coworking-space', 'space-type', $post->ID ) ) { ?>
- <i class="fa fa-lg coworking-space"></i> Coworking Space
- <?php } ?>
- <?php if( has_term( 'shared-office-space', 'space-type', $post->ID ) ) { ?>
- <i class="fa fa-lg shared-office-space"></i> Shared Office Space
- <?php } ?>
- </p>
- </hgroup>
- </li><!--/.room-->
- <?php endwhile; ?>
- <?php wp_reset_postdata(); ?>
- <?php endif; // end loop?>
- <?php restore_current_blog(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement