EV Alumni Test

EV4GH around the globe

‘value’ => $country,
‘compare’ => ‘=’
);
}

if ($year) {
$year_filter = array(
‘key’ => ‘alumni_ev_year’,
‘value’ => $year,
‘compare’ => ‘=’
);
}

if ($region) {
$region_filter = array(
‘key’ => ‘alumni_who_region_of_association’,
‘value’ => $region,
‘compare’ => ‘=’
);
}

if ($starts_with) {
if ($starts_with != “All”) {
$starts_with_filter = array(
‘key’ => ‘alumni_full_name’,
‘value’ => ‘^’ . $starts_with,
‘compare’ => ‘REGEXP’,
);
}
}

if ($search) {
$fields = [‘alumni_full_name’, ‘alumni_country’, ‘alumni_email’, ‘alumni_ev_year’, ‘alumni_who_region_of_association’, ‘alumni_designation’, ‘alumni_area_of_specialty’, ‘alumni_bio’, ‘alumni_status’, ‘alumni_email_alternative’, ‘alumni_current_country_of_residence’, ‘alumni_hpsr’, ‘alumni_linkedin’, ‘alumni_twitter’, ‘alumni_orcid_id’, ‘alumni_researcher_id’];
$search_filter = array(
‘relation’ => ‘OR’,
);

foreach ($fields as $field) {
array_push($search_filter, array(
‘key’ => $field,
‘value’ => $search,
‘compare’ => ‘LIKE’
));
}
}

$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$args = array(
‘paged’ => $paged,
‘posts_per_page’ => ’32’,
‘post_type’ => ‘ev_alumni’,
‘meta_key’ => ‘alumni_full_name’,
‘orderby’ => array(
‘ev_year’ => ‘DESC’,
‘name’ => ‘ASC’
),
‘meta_query’ => array(
‘relation’ => ‘AND’,
$country_filter,
$year_filter,
$region_filter,
$starts_with_filter,
‘name’ => array(
‘key’ => ‘alumni_full_name’,
‘compare’ => ‘EXISTS’,
),
‘ev_year’ => array(
‘key’ => ‘alumni_ev_year’,
‘compare’ => ‘EXISTS’,
//’type’ => ‘numeric’
),
$search_filter
)
);
$query = new WP_Query($args);
$from = ($query->query_vars[‘posts_per_page’] * $paged) – ($query->query_vars[‘posts_per_page’] – 1);
if (($query->query_vars[‘posts_per_page’] * $paged) <= ($query->found_posts)) {
$to = ($query->query_vars[‘posts_per_page’] * $paged);
} else {
$to = $query->found_posts;
}
if ($from == $to) {
$from_to = $from;
} else {
$from_to = $from . ‘ – ‘ . $to;
}
?>

Filter by:


while ($query->have_posts()) : $query->the_post();
$fullname = get_field(‘alumni_full_name’);
$country = get_field(‘alumni_country’);
$email = get_field(‘alumni_email’);
$year = get_field(‘alumni_ev_year’);
$region = get_field(‘alumni_who_region_of_association’);
$designation = get_field(‘alumni_designation’);
$speciality = get_field(‘alumni_area_of_specialty’);
$bio = get_field(‘alumni_bio’);
$alumni_profile_photo = get_field(‘alumni_profile_photo’);
$profile = esc_url($alumni_profile_photo[‘url’]);$status = get_field(‘alumni_status’);
$alt_email = get_field(‘alumni_email_alternative’);
$residence = get_field(‘alumni_current_country_of_residence’);
$hpsr = get_field(‘alumni_hpsr’);
$linkedin = get_field(‘alumni_linkedin’);
$twitter = get_field(‘alumni_twitter’);
$orcid = get_field(‘alumni_orcid_id’);
$researcher = get_field(‘alumni_researcher_id’);
?>

()

,

Consultant,


 

 


Page / of results



<?php get_footer();

Share This