Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function render_team( $team, $options, $is_first_child ){
- extract( $options );
- $default_meta = array(
- 'img_id' => 0,
- 'facebook' => '',
- 'twitter' => '',
- 'linkedin' => ''
- );
- $meta = meta::get_meta( $team -> ID, 'info' );
- foreach( $meta as $entry_key => $entry_value ){
- if( strlen( $entry_value ) ){
- $default_meta[ $entry_key ] = $entry_value;
- }
- }
- extract( $default_meta );
- if( has_post_thumbnail( $team -> ID ) ){
- $size = 'grid_small';
- $img_url = wp_get_attachment_url( get_post_thumbnail_id( $team -> ID ) ,'full'); //get img URL
- $img = aq_resize( $img_url, get_aqua_size($size), get_aqua_size($size, 'height'), true, true); //crop img
- }else{
- $img = get_template_directory_uri() . '/images/default_avatar_100.jpg';
- }
- $networks = array();
- $networks = $default_meta;
- unset($networks['img_id']);
- ?>
- <div class="<?php echo $columns;?> columns">
- <article class="team-text-main">
- <header>
- <div class="featimg">
- <img src="<?php echo $img;?>" alt="<?php echo $team -> post_title;?>" />
- <?php if( strlen( $facebook ) || strlen( $twitter ) || strlen( $linkedin ) ){ ?>
- <div class="socialicons">
- <ul class="cosmo-social"> <?php
- foreach ($networks as $key => $value) { ?>
- <li>
- <a href="<?php echo $value;?>" class="<?php echo $key; ?>"><i class="icon-<?php echo $key; ?>"></i></a>
- </li>
- <?php } ?>
- </ul>
- </div>
- <?php } ?>
- </div>
- </header>
- <div class="entry-content">
- <ul>
- <li class="entry-content-name"><h4><?php echo $team -> post_title;?></h4></li>
- <li class="entry-content-function"><?php echo $team -> post_content;?></li>
- </ul>
- </div>
- </article>
- </div>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment