I'm working with a company's About page. I created a custom post type for "Employees", and am using the Advanced Custom Fields plugin to create simple meta boxes for name, title, image, and bio.
The first employee listed is the owner, and i'd like to style his bio differently from the rest, but my php skills aren't quite up to the task.
Here is the code i'm working with so far, I just need to understand how to create a variable for the first post in the array and style it differently.
<?php
$args = array('post_type' => 'employee');
$employee= new WP_Query( $args );
if( $employee->have_posts() ) {
while( $employee->have_posts() ) {
$employee->the_post();
?>
<div <?php post_class('portrait'); ?>>
<img src="<?php the_field('employee_photo'); ?>" alt="" />
<h3><?php the_title() ?></h3>
<span><?php the_field('employee_title'); ?></span>
<p><?php the_field('employee_bio'); ?></p>
</div>
<?php
}
}
else { ?>
<div class="portrait">
<img src="<?php the_field('employee_photo'); ?>" alt="" />
<h3><?php the_title() ?></h3>
<span><?php the_field('employee_title'); ?></span>
<p><?php the_field('employee_bio'); ?></p>
</div>
<?php } ?>
