<div id="options">
      	<ul id="filters" class="option-set clearfix" data-option-key="filter">
        <li><a href="#filter" data-option-value="*" class="selected">show all</a></li>
  		<li><a href="#filter" data-option-value=".endo">Endodontics</a></li>
  		<li><a href="#filter" data-option-value=".ohs">Oral Health Sciences</a></li>
		<li><a href="#filter" data-option-value=".oms">Oral and Maxillofacial Surgery</a></li>
		<li><a href="#filter" data-option-value=".oralmed">Oral Medicine</a></li>
		<li><a href="#filter" data-option-value=".ortho">Orthodontics</a></li>
        <li><a href="#filter" data-option-value=".pedo">Pediatric Dentistry</a></li>
	    <li><a href="#filter" data-option-value=".perio">Periodontics</a></li>
    	<li><a href="#filter" data-option-value=".restore">Restorative Dentistry</a></li>
      </ul>
  	</div> <!-- #options -->
    <?php 
    $teams = dont_group_by_team($people);
    foreach ($teams as $team => $people) {
        if (count($people) != 0) {
            ?>
                   <div id='isotope' class='searchable-container clearfix'>
                    <?php 
            foreach ($people as $person) {
                $personID = $person->ID;
                $name = $person->post_title;
                $main_pic = get_post_meta($personID, 'main_pic', true);
                $position = get_post_meta($personID, 'position', true);
                $phone = get_post_meta($personID, 'phone', true);
                $email = get_post_meta($personID, 'email', true);
                $person_teams_arr = get_the_terms($personID, 'teams');
                $team_class = '';
                $person_teams = '';
    function deptfacultydir_shortcode($atts)
    {
        $a = shortcode_atts(array('dept' => 'Endodontics'), $atts);
        $args = array('post_type' => 'people', 'posts_per_page' => -1);
        $query = new WP_Query($args);
        $people = $query->get_posts();
        usort($people, 'last_name_sort');
        $people[0]->post_title;
        $name_link = true;
        $teams = dont_group_by_team($people);
        foreach ($teams as $team => $people) {
            if (count($people) != 0) {
                ?>
     <div id='isotope' class='searchable-container clearfix'>
                    <?php 
                foreach ($people as $person) {
                    $thisPerson = false;
                    $personID = $person->ID;
                    $name = $person->post_title;
                    $main_pic = get_post_meta($personID, 'main_pic', true);
                    $position = get_post_meta($personID, 'position', true);
                    $phone = get_post_meta($personID, 'phone', true);
                    $email = get_post_meta($personID, 'email', true);
                    $content = $person->post_content;
                    $person_teams_arr = get_the_terms($personID, 'teams');
                    $person_teams = '';
                    if (!empty($person_teams_arr)) {
                        $count = 0;
                        foreach ($person_teams_arr as $person_teams_item) {
                            if ($person_teams_item->name == $a['dept']) {
                                $thisPerson = true;
                            }
                            if ($count == 0) {
                                $person_teams = $person_teams . ' ' . $person_teams_item->name;
                            } else {
                                $person_teams = $person_teams . ', ' . $person_teams_item->name;
                            }
                            $count++;
                        }
                    }
                    if ($thisPerson == true) {
                        ?>
                <div class='profile-list searchable element'>     
                          <div class='pic'><img width='75' height='100' <?php 
                        if (empty($main_pic)) {
                            ?>
 class='no-pic'<?php 
                        }
                        ?>
 src='<?php 
                        echo $main_pic;
                        ?>
' alt='<?php 
                        echo $name;
                        ?>
' /></div>
                            <div class='info'>
                                <?php 
                        if ($name_link & !empty($content)) {
                            ?>
<a href="<?php 
                            echo get_permalink($personID);
                            ?>
"><?php 
                        }
                        ?>
                                <p class='name search-this'><?php 
                        echo $name;
                        ?>
</p>
                                <?php 
                        if ($name_link & !empty($content)) {
                            ?>
                                    </a>
                                    <?php 
                        }
                        ?>
                                <p class='title search-this'><?php 
                        echo $position;
                        ?>
</p>
                                								                                                        
                                <p> <?php 
                        echo $phone;
                        ?>
</p>
                                <p> <a href="mailto:<?php 
                        echo $email;
                        ?>
 "><?php 
                        echo $email;
                        ?>
</a></p>
                            </div>
                        </div>
                    <?php 
                    }
                }
                ?>
 
				 </div>
                <?php 
            }
        }
    }
Esempio n. 3
0
 function deptfacultydir_shortcode($atts)
 {
     $a = shortcode_atts(array('dept' => 'Endodontics'), $atts);
     $args = array('post_type' => 'people', 'posts_per_page' => -1);
     $query = new WP_Query($args);
     $people = $query->get_posts();
     usort($people, 'last_name_sort');
     $people[0]->post_title;
     $name_link = true;
     $teams = dont_group_by_team($people);
     foreach ($teams as $team => $people) {
         if (count($people) != 0) {
             $short_content .= "<div id='isotope' class='searchable-container clearfix'>";
             foreach ($people as $person) {
                 $thisPerson = false;
                 $personID = $person->ID;
                 $name = $person->post_title;
                 $main_pic = get_post_meta($personID, 'main_pic', true);
                 $position = get_post_meta($personID, 'position', true);
                 $phone = get_post_meta($personID, 'phone', true);
                 $email = get_post_meta($personID, 'email', true);
                 $content = $person->post_content;
                 $person_teams_arr = get_the_terms($personID, 'teams');
                 $person_teams = '';
                 if (!empty($person_teams_arr)) {
                     $count = 0;
                     foreach ($person_teams_arr as $person_teams_item) {
                         if ($person_teams_item->name == $a['dept']) {
                             $thisPerson = true;
                         }
                         if ($count == 0) {
                             $person_teams = $person_teams . ' ' . $person_teams_item->name;
                         } else {
                             $person_teams = $person_teams . ', ' . $person_teams_item->name;
                         }
                         $count++;
                     }
                 }
                 if ($thisPerson == true) {
                     $short_content .= "<div class='profile-list searchable element'>";
                     if (!empty($main_pic)) {
                         $short_content .= "<div class='pic'><img width='75' height='100'  src='" . $main_pic . "' alt='" . $name . "' /></div>";
                     }
                     $short_content .= "<div class='info'><p class='name search-this'><a href=" . get_permalink($personID) . ">";
                     $short_content .= $name;
                     $short_content .= "</a></p>";
                     $short_content .= "<p class='title search-this'>" . $position . "</p>";
                     if (!empty($phone)) {
                         $short_content .= "<p>" . $phone . "</p>";
                     }
                     if (!empty($email)) {
                         $short_content .= "<p><a href='mailto:" . $email . "'>" . $email . "</a></p>";
                     }
                     $short_content .= "</div>";
                     $short_content .= "</div>";
                 }
             }
             $short_content .= "</div>";
         }
     }
     wp_reset_postdata();
     return $short_content;
 }