nlozovan

Untitled

May 2nd, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. static function render_team( $team, $options, $is_first_child ){
  2. extract( $options );
  3.  
  4. $default_meta = array(
  5. 'img_id' => 0,
  6. 'facebook' => '',
  7. 'twitter' => '',
  8. 'linkedin' => ''
  9. );
  10. $meta = meta::get_meta( $team -> ID, 'info' );
  11. foreach( $meta as $entry_key => $entry_value ){
  12. if( strlen( $entry_value ) ){
  13. $default_meta[ $entry_key ] = $entry_value;
  14. }
  15. }
  16.  
  17.  
  18. extract( $default_meta );
  19. if( has_post_thumbnail( $team -> ID ) ){
  20.  
  21. $size = 'grid_small';
  22.  
  23. $img_url = wp_get_attachment_url( get_post_thumbnail_id( $team -> ID ) ,'full'); //get img URL
  24.  
  25. $img = aq_resize( $img_url, get_aqua_size($size), get_aqua_size($size, 'height'), true, true); //crop img
  26.  
  27. }else{
  28. $img = get_template_directory_uri() . '/images/default_avatar_100.jpg';
  29. }
  30.  
  31. $networks = array();
  32. $networks = $default_meta;
  33. unset($networks['img_id']);
  34.  
  35. ?>
  36. <div class="<?php echo $columns;?> columns">
  37. <article class="team-text-main">
  38. <header>
  39. <div class="featimg">
  40. <img src="<?php echo $img;?>" alt="<?php echo $team -> post_title;?>" />
  41. <?php if( strlen( $facebook ) || strlen( $twitter ) || strlen( $linkedin ) ){ ?>
  42. <div class="socialicons">
  43. <ul class="cosmo-social"> <?php
  44.  
  45. foreach ($networks as $key => $value) { ?>
  46. <li>
  47. <a href="<?php echo $value;?>" class="<?php echo $key; ?>"><i class="icon-<?php echo $key; ?>"></i></a>
  48. </li>
  49.  
  50. <?php } ?>
  51. </ul>
  52. </div>
  53. <?php } ?>
  54. </div>
  55. </header>
  56. <div class="entry-content">
  57. <ul>
  58. <li class="entry-content-name"><h4><?php echo $team -> post_title;?></h4></li>
  59. <li class="entry-content-function"><?php echo $team -> post_content;?></li>
  60. </ul>
  61. </div>
  62. </article>
  63. </div>
  64. <?php
  65. }
Advertisement
Add Comment
Please, Sign In to add comment