Commit fe1983e2 authored by Stefan.Bruckner's avatar Stefan.Bruckner
Browse files

group heads

parent 1105aef9
......@@ -34,25 +34,47 @@ the_post();
<div class="team-info col-md-8">
<?php
$group_args = array(
$head_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_members',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
);
// query
$group_query = new WP_Query( $group_args );
$head_query = new WP_Query( $head_args );
// loop
while( $group_query->have_posts() )
if ( $head_query->have_posts())
{
while( $head_query->have_posts() )
{
$head_query->the_post();
echo "Head <a href=". get_permalink($head_query->ID) . ">" . get_the_title($head_query->ID) . "</a></li>";
}
}
else
{
$group_query->the_post();
echo "<a href=". get_permalink($group_query->ID) . ">" . get_the_title($group_query->ID) . "</a></li>";
$group_args = array(
'post_type' => 'Groups',
'meta_query' => array(
array(
'key' => 'group_members',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
);
$group_query = new WP_Query( $group_args );
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();
?>
......
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