Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 37d45ac

Browse files
committed
add individual team member pages
1 parent 6f367c9 commit 37d45ac

File tree

4 files changed

+129
-23
lines changed

4 files changed

+129
-23
lines changed

functions.php

+12
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,18 @@ function create_post_type() {
157157
'show_in_nav_menus' => true
158158
)
159159
);
160+
register_post_type( 'dhrees-team-member',
161+
array(
162+
'labels' => array(
163+
'name' => __( 'Team Members' ),
164+
'singular_name' => __( 'Team Member' )
165+
),
166+
'public' => true,
167+
'has_archive' => true,
168+
'supports' => array( 'title', 'editor', 'thumbnail' ),
169+
'show_in_nav_menus' => true
170+
)
171+
);
160172
}
161173

162174

category-about.php page-about.php

+24-23
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@
2121
<div class="about-text-column">
2222
<div class="image-stripe about-text-stripe"></div>
2323
<div class="about-text-container">
24-
<?php $query = new WP_Query( array( 'category_name' => 'about-text' ) );
24+
<?php $query = new WP_Query( array( 'pagename' => 'about' ) );
2525
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
26-
<div class="about-text about-text-title">
27-
<?php echo get_post_meta($post->ID, 'about-title', true); ?>
28-
</div>
29-
<div class="about-text about-subtitle">
30-
<?php echo get_post_meta($post->ID, 'about-subtitle', true); ?>
31-
</div>
26+
<div class="about-text about-text-title">About Us</div>
3227
<div class="about-text about-text-main">
3328
<?php the_content(); ?>
3429
</div>
@@ -40,26 +35,32 @@
4035
<!-- Team member cards -->
4136
<div class="team-member-cards-container">
4237
<?php $query = new WP_Query( array(
43-
'category_name' => 'team-member',
44-
'meta_key' => 'sort-order',
38+
'post_type' => 'dhrees-team-member',
39+
'posts_per_page' => -1,
40+
'meta_key' => 'display_order',
4541
'orderby' => 'meta_value_num',
46-
'order' => 'ASC' ) );
42+
'order' => 'ASC'
43+
) );
44+
4745
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
4846

49-
<div class="team-member-card">
50-
<div class="team-member-thumbnail">
51-
<?php the_post_thumbnail('thumbnail'); ?>
52-
</div>
53-
<div class="team-member-text-container">
54-
<div class="team-member-text team-member-name">
55-
<?php echo get_post_meta($post->ID, 'team-member-name', true); ?>
47+
<a href="<?php echo the_permalink(); ?>">
48+
<div class="team-member-card">
49+
<div class="team-member-thumbnail">
50+
<?php the_post_thumbnail('thumbnail'); ?>
5651
</div>
57-
<div class="team-member-text team-member-position">
58-
<?php echo get_post_meta($post->ID, 'team-member-position', true); ?>
59-
</div>
60-
</div><!-- .team-member-text-container -->
61-
<div class="team-member-hover-stripe"></div>
62-
</div><!-- .team-member-card -->
52+
<div class="team-member-text-container">
53+
<div class="team-member-text team-member-name">
54+
<?php echo get_field("name"); ?>
55+
</div>
56+
<div class="team-member-text team-member-position">
57+
<?php echo get_field("position"); ?>
58+
</div>
59+
</div><!-- .team-member-text-container -->
60+
<div class="team-member-hover-stripe"></div>
61+
</div>
62+
</a><!-- .team-member-card -->
63+
6364
<?php endwhile; endif; ?>
6465
<?php wp_reset_postdata(); ?>
6566
</div><!-- .team-member-cards-container -->

single-dhrees-team-member.php

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/**
3+
* The template for displaying all single posts.
4+
*
5+
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
6+
*
7+
* @package _s
8+
*/
9+
10+
get_header(); ?>
11+
12+
<div id="primary" class="content-area">
13+
<div class="single-page single-project"></div>
14+
<main id="main" class="site-main" role="main">
15+
16+
<?php while ( have_posts() ) : the_post(); ?>
17+
18+
<div class="featured-project-container">
19+
<div class="featured-project-image-container featured-event-image-container">
20+
<div class="featured-event-text-container">
21+
<div class="featured-event-text-wrap">
22+
<div class="subtitle">PROFILE</div>
23+
<div class="featured-event-title"><?php the_title(); ?></div>
24+
<div class="featured-item-position"><?php echo get_field("position") ?></div>
25+
</div>
26+
</div>
27+
</div>
28+
<div class="featured-project-image featured-event-image"
29+
style="background-image: url(<?php the_post_thumbnail_url('original'); ?>)" ></div>
30+
31+
</div>
32+
33+
<div class="featured-project-container">
34+
<div class="event-full-text-container">
35+
<?php echo the_content();
36+
endwhile; // End of the loop. ?>
37+
</div>
38+
</div>
39+
40+
<?php $post_objects = get_field('related_links'); ?>
41+
<?php if( $post_objects ): ?>
42+
<div class="related-posts">
43+
<div class="related-posts-title">RELATED</div>
44+
<!-- variable must be called $post -->
45+
<?php foreach( $post_objects as $post): ?>
46+
<?php setup_postdata($post); ?>
47+
<a class="related-post" href="#<?php the_permalink(); ?>"><?php the_title(); ?></a>
48+
<?php endforeach; ?>
49+
<?php wp_reset_postdata(); ?>
50+
</div>
51+
<?php endif; ?>
52+
53+
<?php $terms = get_field('tags'); ?>
54+
<?php if($terms): ?>
55+
<div class="tag-links">
56+
<div class="tag-links-title">TAGS</div>
57+
<?php foreach( $terms as $term ): ?>
58+
<?php if( $term->name ): ?>
59+
<a class="tag-link" href="#<?php echo get_term_link( $term );?>">
60+
<span><?php echo $term->name; ?></span>
61+
</a>
62+
<?php endif; ?>
63+
<?php endforeach; ?>
64+
</div>
65+
<?php endif; ?>
66+
67+
<!-- Parallelograms -->
68+
<div class="clear-both"></div>
69+
<div class="events-parallelograms">
70+
<?php get_template_part( 'template-parts/contact-parallelograms', 'none' ); ?>
71+
</div>
72+
</main><!-- #main -->
73+
</div><!-- #primary -->
74+
75+
<?php
76+
get_footer();

style.css

+17
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ a.featured-project-link {
14281428
display: inline-block;
14291429
position: absolute;
14301430
right: 0;
1431+
top: 0;
14311432
}
14321433

14331434
/***
@@ -1633,6 +1634,7 @@ a.featured-project-link {
16331634
top: -69%;
16341635
background: rgba(255,255,255,0.4);
16351636
overflow: hidden;
1637+
z-index: 1;
16361638
}
16371639

16381640
.about-text {
@@ -1671,6 +1673,10 @@ a.featured-project-link {
16711673
width: 400px;
16721674
}
16731675

1676+
.team-member-cards-container a {
1677+
text-decoration: none;
1678+
}
1679+
16741680
.team-member-card {
16751681
background: rgba(241,229,217,.93);
16761682
margin-bottom: 30px;
@@ -1693,6 +1699,7 @@ a.featured-project-link {
16931699
font-size: 1.475em;
16941700
line-height: 1.15em;
16951701
font-family: YaleNew;
1702+
color: #00356B;
16961703
}
16971704

16981705
.team-member-position {
@@ -1716,6 +1723,16 @@ a.featured-project-link {
17161723
background: #EF6362;
17171724
}
17181725

1726+
/***
1727+
* Individual team member page
1728+
***/
1729+
1730+
.featured-item-position {
1731+
font-style: italic;
1732+
margin-top: 15px;
1733+
}
1734+
1735+
17191736
/***
17201737
* Showcase Projects
17211738
***/

0 commit comments

Comments
 (0)