Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good morning

ACF & Bootstrap Staff / Team Page Template for WordPress

This post was last updated: Sep 3, 2020
SnippetsWordPress

About a 1 minute read

"There is one thing one has to have: either a soul that is cheerful by nature, or a soul made cheerful by work, love, art, and knowledge."

Friedrich Nietzsche


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
Template Name: Staff
*/


get_header(); ?>
<div class="container text-center">
    <h2><?php the_title(); ?></h2>
</div>

<div id="staff" class="container">
    <div class="entry">
        <?php the_content(); ?>
    </div>
   
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <article <?php post_class(array('text-center','row')) ?> id="post-<?php the_ID(); ?>">
            <?php if( have_rows('staff') ): ?>

            <ul>
       
            <?php while( have_rows('staff') ): the_row();
                $image = get_sub_field('image');
                $name = get_sub_field('name');
                $title = get_sub_field('title');
                $phone = get_sub_field('phone');
                $email = get_sub_field('email');
                ?>            
           
                <li class="col-sm-4 col-md-3 card" style="background-image: url(<?php echo $image['url']; ?>);">
                    <div class="avatar">
                        <?php if ($image){ ?>
                            <img class="img-responsive" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />
                        <?php }else{ ?>
                            <img class="img-responsive" src="http://placehold.it/300x200">
                        <?php } ?>
                    </div>
                    <div class="content">
                        <h2><?php echo $name; ?></h2>
                        <h3><?php echo $title; ?></h3>
                        <p><?php echo $phone; ?></p>
    <!--                    <p><button type="button" class="btn btn-default">Contact</button></p> -->
                    </div>
                    <div class="email"><a href="<?php echo $email; ?>"><i class="fa fa-envelope"></i>Email</a></div>
                </li>
       
            <?php endwhile; ?>
            </ul>

            <?php endif; ?>
        </article>
    <?php endwhile; ?>
    <?php else : ?>
        <h2>Not Found</h2>
    <?php endif; ?>

</div>
<?php get_footer(); ?>