Skip to content

Instantly share code, notes, and snippets.

@JacquesJahnichen
Last active February 21, 2017 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacquesJahnichen/c182fb6b7ae58f680db217c9483e1188 to your computer and use it in GitHub Desktop.
Save JacquesJahnichen/c182fb6b7ae58f680db217c9483e1188 to your computer and use it in GitHub Desktop.
People add on custom template
<?php
/**
* Template file to add extra content to a single person display
* Note: To customize, just copy the template from /public/templates/* and put in your theme folder.
* @since 1.0.0
* @package EE People Addon
* @subpackage template
* @author Darren Ethier
*/
global $post;
$events = EEH_People_View::get_events_for_person();
?>
<style type="text/css">
div.entry-content p, header.entry-header {
display:none;
}
div.entry-content > center:first-child img{
display:none;
}
div.entry-content > div.presentation-organizer {
display:none;
}
</style>
<div class="eea-people-addon-person-events-container">
<div class="event-top">
<div class="event-ticket">
<?php
echo genesis_do_post_title();
$id_people = get_the_ID();
$value = get_field( "field_586a28f9d6446", $id_people );
if( $value == 1) {
echo '</br>';
echo do_shortcode('[vivi-devis-form]');
}
?>
</div>
<div class="event-image">
<center style="margin-top: 25px;"><?php the_post_thumbnail('medium'); ?></center>
</div>
</div>
<h4 id="anchor-workshops-creates" class="compte-presentation">Sa biographie</h4>
<?php echo get_the_content();?>
<?php if ( $events ) : ?>
</br>
<h4 id="anchor-workshops-creates" class="compte-presentation">Ses ateliers</h4>
<?php foreach ( $events as $type => $event ) : ?>
<div class="eea-people-addon-people-type-container">
<!-- <h4 class="eea-people-addon-people-type-label">< ?php echo $type; ?></h4> -->
<?php foreach ( $event as $evt ) :
/* Categorie pour extraire ville*/
$terms = get_the_terms($evt->ID() , 'espresso_event_categories' );
if ($terms && ! is_wp_error($terms)) :
$term_slugs_arr = array();
foreach ($terms as $term) {
if ($term->term_id > 71 ) {
$term_slugs_arr[] = $term->slug;
}
}
$terms_slug_str = join( " - ", $term_slugs_arr);
$terms_slug_str .= " ";
endif;
?>
<li>
<a class="eea-people-addon-link-to-event" href="<?php echo get_permalink( $evt->ID() ); ?>" title="<?php printf( __('Click here to view more info about %s', 'event_espresso' ), $evt->name() ); ?>"><span class="eea-people-addon-event-name"><?php echo $evt->name(); ?> - <span class="categoryatelier"><?php echo $terms_slug_str?></span></span></a>
</li>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment