/
single-profile.php
58 lines (44 loc) · 1.74 KB
/
single-profile.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
<?php
/**
* The Template for displaying all single posts
*
* Please see /external/starkers-utilities.php for info on Starkers_Utilities::get_template_parts()
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 4.0
*/
?>
<?php Starkers_Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
<main>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article class="profile">
<?php
$related_post = get_custom_field('graduated_from:get_post');
$program_color = $related_post['program_color'];
if ($program_color != ''):
?>
<div id="program-color" style="display: none; color: #<?php echo $program_color ?>;"></div>
<?php endif; ?>
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<div id="profile-featured-image" style="background-image: url('<?php echo $image[0]; ?>')"></div>
<div id="profile-title">
<h1><?php the_title(); ?></h1><br />
<h2><?php print_custom_field('associated_company'); ?></h2>
</div>
<?php else: ?>
<div id="profile-title">
<h1><?php the_title(); ?></h1><br />
<h2><?php print_custom_field('associated_company'); ?></h2>
</div>
<?php endif; ?>
<div id="profile-content">
<?php the_content(); ?>
</div>
<!-- Shortcode doesn't seem to work, just hardcoding the HTML in here, suppose it's the same anyway -->
<a href="http://buildinstitute.org/meet-our-grads/" class="ghost-button-a"><span class="ghost-button arrow-left">Back to all profiles</span></a>
</article>
<?php endwhile; ?>
</main>
<?php Starkers_Utilities::get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer' ) ); ?>