Skip to content

Commit

Permalink
Displays waste picker group and country in biography for all visitors
Browse files Browse the repository at this point in the history
  • Loading branch information
numeroteca committed Feb 27, 2017
1 parent e1e8639 commit 028ff2f
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions single-bio.php
Expand Up @@ -13,35 +13,41 @@
</div>
<div class="col-md-2">
<?php if ( is_user_logged_in() ) { ?><div class="btn btn-xs btn-default pull-right"> <?php edit_post_link(__('Edit This')); ?></div> <?php } ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?php the_post_thumbnail( 'medium',array('class'=> "img-rounded img-responsive",'alt'=> ''.get_the_title().'','title' => ''.get_the_title().'') ); ?> <br>
<?php if ( is_user_logged_in() ) { ?>
<dl>
<dt>email</dt> <?php
<?php
global $post;
echo "<dd>".get_post_meta( $post->ID, 'bio_email', true )."</dd>";
echo "<dt>Telephone</dt>";
echo "<dd>".get_post_meta( $post->ID, 'bio_telephone', true )."</dd>";
$postid = $post->ID;
if ( is_user_logged_in() ) { ?>
<dt>email</dt>
<?php
echo "<dd>".get_post_meta( $postid, 'bio_email', true )."</dd>";
echo "<dt>Telephone</dt>";
echo "<dd>".get_post_meta( $postid, 'bio_telephone', true )."</dd>";
}
//retrieve Country
$country_id = get_post_meta( $post->ID, 'bio_country', true );
$country_id = get_post_meta( $postid, 'bio_country', true );
$country = get_post($country_id);
$country_link = get_permalink($country->ID);
$country_name = $country->post_title;
echo '<dt>Country</dt><dd><a href="'.$country_link.'">'.$country_name.'</a></dd>';
//retrieve Waste Picker group
$group_id = get_post_meta( $post->ID, 'bio_group', true );
$group_id = get_post_meta( $postid, 'bio_group', true );
$group = get_post($group_id);
$group_link = get_permalink($group->ID);
$group_link = get_permalink($postid);
$group_name = $group->post_title;
echo '<dt><span class="dashicons groups-dashicon"></span>Waste Picker Group</dt><dd><a href="'.$group_link.'">'.$group_name.'</a></dd>';
}?>
echo '<dt>Country</dt><dd><a href="'.$country_link.'">'.$country_name.'</a></dd>';
if ($group_name != get_the_title() ) {
echo '<dt><span class="dashicons groups-dashicon"></span>Waste Picker Group</dt><dd><a href="'.$group_link.'">'.$group_name.'</a></dd>';
}
?>
</dl>
</div>
<div class="col-md-7">
<div class="col-md-7 content">
<h2><?php the_title(); ?></h2>
<?php the_content(__('(more...)')); ?>
</div>
Expand All @@ -54,5 +60,5 @@
<?php endif; ?>
</div>
<?php get_footer(); ?>

</div>

0 comments on commit 028ff2f

Please sign in to comment.