function ciGetEmployeesHTML($employeesPerRow = 1, $numEmployees = 100, $headingLevel = 3, $maxCharLength = -1, $listOnly = false) { if (!function_exists('ciGetEmployeeInnerHTML')) { function ciGetEmployeeInnerHTML($employee, $headingLevel, $floatImg = "right", $listOnly) { $imgClass = "employee-img"; if ($floatImg == "right") { $imgClass .= " alignright ml20"; } else { if ($floatImg == "left") { $imgClass .= " alignleft mr20"; } } $out = ""; if (strlen($employee['imgURL']) > 0) { $out .= " <a href=\"{$employee['url']}\"><img alt=\"{$employee['title']}\" src=\"{$employee['imgURL']}\" width=\"{$employee['imgWidth']}\" height=\"{$employee['imgHeight']}\" class=\"{$imgClass}\" itemprop=\"image\"></a>\n"; } $a = "<a href=\"{$employee['url']}\" itemprop=\"name\">{$employee['title']}</a>"; if ($listOnly) { return $a; } $out .= " <h{$headingLevel}>{$a}</h{$headingLevel}>\n"; $out .= " {$employee['content']}\n"; $out .= ""; return $out; } } $employees = ciGetAllStaff($numEmployees, $maxCharLength); if (count($employees) == 0) { return ""; } $liClass = "employee"; $ulClass = ""; if ($employeesPerRow > 1) { $ulClass .= " row"; $colWidth = 12 / $employeesPerRow; $liClass .= " col-sm-{$colWidth}"; } $out = "<div class=\"employees\">"; if (count($employees) > 1) { $out .= "<ul class=\"{$ulClass}\">\n"; for ($i = 0; $i < count($employees); $i++) { $out .= "<li class=\"{$liClass}\" itemscope itemtype=\"http://schema.org/Person\">\n"; $out .= ciGetEmployeeInnerHTML($employees[$i], $headingLevel, "none", $listOnly); $out .= "</li>\n"; } $out .= "</ul>\n"; } else { $out .= ciGetEmployeeInnerHTML($employees[0], $headingLevel, "right", $listOnly); } $out .= "</div>"; return $out; }
<!-- content-staff --> <?php while (have_posts()) { the_post(); ?> <div class="entry-content"> <?php the_content(); ?> </div> <?php } $contentLength = 250; $staff = ciGetAllStaff(100, $contentLength); ?> <div class="staff"> <?php foreach ($staff as $i => $staffMember) { if ($i % 2 == 0) { ?> <div class="row"><?php } ?> <div id="post-<?php echo $staffMember['id']; ?> " class="main individual-post mb35 col-md-6" itemscope itemtype="http://schema.org/Person"><?php if ($staffMember['imgURL'] != '') { ?> <div class="text-center"> <a href="<?php