Commit 33a5d6dc authored by Stefan.Bruckner's avatar Stefan.Bruckner
Browse files

group membership

parent 6d4bf66d
......@@ -33,57 +33,58 @@ the_post();
<?php } ?>
<div class="team-info col-md-8">
<?php
$head_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_head',
'value' => get_the_ID(),
)
)
);
<h2><?php the_field('team_position'); ?></h2>
<p><?php the_field('team_topics'); ?></p>
<div class="team-details">
<ul class="fa-ul">
<?php
$head_query = new WP_Query( $head_args );
if ( $head_query->have_posts())
{
while( $head_query->have_posts() )
{
$head_query->the_post();
echo "<i class='fa fa-users'></i> Head <a href=". get_permalink($head_query->ID) . ">" . get_the_title($head_query->ID) . "</a></li>";
}
}
else
{
$group_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_members',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
$head_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_head',
'value' => get_the_ID(),
)
)
)
);
);
$group_query = new WP_Query( $group_args );
$head_query = new WP_Query( $head_args );
if ( $head_query->have_posts())
{
while( $head_query->have_posts() )
{
$head_query->the_post();
echo "<i class='fa fa-users'></i>Head <a href=". get_permalink($head_query->ID) . ">" . get_the_title($head_query->ID) . "</a></li>";
}
}
else
{
$group_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_members',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
);
while( $group_query->have_posts() )
{
$group_query->the_post();
echo "<a href=". get_permalink($group_query->ID) . ">" . get_the_title($group_query->ID) . "</a></li>";
}
}
wp_reset_postdata();
?>
$group_query = new WP_Query( $group_args );
<h2><?php the_field('team_position'); ?></h2>
<p><?php the_field('team_topics'); ?></p>
while( $group_query->have_posts() )
{
$group_query->the_post();
echo "<i class='fa fa-users'></i><a href=". get_permalink($group_query->ID) . ">" . get_the_title($group_query->ID) . "</a></li>";
}
}
wp_reset_postdata();
?>
<div class="team-details">
<ul class="fa-ul">
<?php if ($email = get_field('team_email')): ?>
<li><i class="fa fa-envelope fa-li"></i><a href="mailto:<?php echo antispambot($email); ?>"><?php echo antispambot($email); ?></a></li>
<?php endif; ?>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment