/** * Show related results * @param $nae */ function show_related_results($name) { $projects_args = array('post_type' => 'result', 'posts_per_page' => 4, 'tax_query' => array('relation' => 'OR', array('taxonomy' => 'sector', 'field' => 'slug', 'terms' => $name), array('taxonomy' => 'focus_areas_of_impact', 'field' => 'slug', 'terms' => $name))); $results_query = new WP_Query($projects_args); if (!empty($results_query->posts)) { echo '<h5 class="[ hometitle ]">Related Results</h5>'; echo '<div class="[ isotope-container ]">'; foreach ($results_query->posts as $key => $post) { echo '<div class="[ rowtight ]">'; echo '<div class="[ post ][ tcol-ss-12 tcol-sm-6 tcol-md-12 ]">'; echo '<div class="[ post__card ]">'; echo '<h4 class="[ post__title ][ no-margin ]">'; echo '<a href="' . get_the_permalink($post->ID) . '">'; echo $post->post_title; echo '</a>'; echo '</h4>'; if (get_implementing_partner($post->ID) != '') { echo '<p class="[ post__implementing-partner ]">Implementing partner:' . get_implementing_partner($post->ID) . '</p>'; } echo '</div>'; echo '</div>'; echo '</div>'; } echo '</div>'; } }
//Context $year_of_publication = get_result_meta($post->ID, '_year_of_publication_meta'); //Year of Publicaction $authors = get_result_meta($post->ID, '_authors_meta'); //Authors $institution = get_result_meta($post->ID, '_institution_meta'); //Institution $city = get_result_meta($post->ID, '_city_meta'); //City $cityb = get_result_meta($post->ID, '_city_meta_b'); $cityc = get_result_meta($post->ID, '_city_meta_c'); $cityd = get_result_meta($post->ID, '_city_meta_d'); $citye = get_result_meta($post->ID, '_city_meta_e'); $url = get_result_meta($post->ID, '_url_meta'); //URL $implementing_partner = get_implementing_partner($post->ID); //Implementing partner $region = get_region($post->ID); //Implementing partner $sector = get_sector($post->ID); //Implementing partner ?> <div id="pageheader" class="titleclass"> <div class="header-color-overlay"></div> <div class="container"> <div class="page-header"> <div class="row"> <div class="col-md-12"> <h1 class="post_page_title entry-title" itemprop="name headline">Result - <?php echo get_the_title();