/** * Find if item in array matches the page's location terms */ function location_match($post, $parentPost) { if (TAX_LOCATION == TRUE) { $locations = get_the_terms($post->ID, 'locations'); if (!empty($locations)) { foreach ($locations as $location) { if (find_location_terms($parentPost) == $location->slug) { return true; } } } } }
$location_image_2 = get_field('location_image_2'); if (!empty($location_image_2)) { $location_image_2_alt = $location_image_2['alt']; $location_image_2_size = 'large'; $location_image_2_thumb = $location_image_2['sizes'][$location_image_2_size]; $location_image_2_width = $location_image_2['sizes'][$location_image_2_size . '-width']; $location_image_2_height = $location_image_2['sizes'][$location_image_2_size . '-height']; } $intro_background_image = get_field('intro_image'); $quote_background_image = get_field('quote_background_image'); $form_background_image = get_field('form_background_image'); $posts_background_image = get_field('posts_background_image'); $toggleslide_background_image = get_field('toggleslide_background_image'); $query_array = array(); if (TAX_LOCATION == TRUE) { array_push($query_array, array('taxonomy' => 'locations', 'field' => 'slug', 'terms' => find_location_terms($post))); } get_header(); $row_num = 0; ?> <!-- INTRO-SECTION --> <section class="section section__intro" <?php tt_background_image($intro_background_image); ?> > <div class="section__inner-wrapper">