-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-team.php
60 lines (54 loc) · 1.97 KB
/
page-team.php
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
59
60
<?php
/* Template Name: Team Page */
get_header();
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
$team_args = array(
'post_type' => 'team',
'numberposts'=> -1,
'posts_per_page'=> -1,
'post_status'=> 'publish',
'meta_key' => 'grid_order',
'orderby' => 'meta_value_num',
'order' => 'ASC'
);
$team_members = new WP_Query( $team_args );
?>
<article class="team bg-image-wrap" data-type="background" data-background="<?php echo($image[0]); ?>">
<section class="centerpiece intro-header">
<h1>Team</h1>
<p><?php echo($post->post_content); ?></p>
</section>
</article>
<article class="team-profiles">
<?php
if ( $team_members->have_posts() ) while ( $team_members->have_posts() ) : $team_members->the_post();
?>
<style>
.<?php echo the_slug(); ?> {
background: url("<?php the_field('profile_picture'); ?>") no-repeat center center;
background-size: cover; }
.<?php echo the_slug(); ?>:hover {
background: url("<?php the_field('picture_alt'); ?>") no-repeat center center;
background-size: cover; }
</style>
<section class="featured col-4-12">
<a href="<?php the_permalink(); ?>">
<div class="<?php echo the_slug(); ?> profile-contain">
<img data-alternate="<?php the_field('picture_alt'); ?>" src="<?php the_field('profile_picture'); ?>"/>
</div>
<h2><?php the_title(); ?></h2>
</a>
</section>
<?php
endwhile;
wp_reset_postdata();
?>
</article>
<script type="text/javascript">
$('.profile-contain').children('img').hover(function() {
$(this).attr('src', $(this).attr('alt')).stop(true, true);
}, function() {
$(this).attr('src', $(this).attr('rel')).stop(true, true);
});
</script>
<?php get_footer(); ?>