forked from jspellman814/wordpress-composer-managed
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from MITLibraries/lm420
Update Child theme to better support Interview / Interviewees content
- Loading branch information
Showing
8 changed files
with
288 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
/** | ||
* The template for displaying the archive of all Interviewee records. | ||
* | ||
* Learn more: http://codex.wordpress.org/Template_Hierarchy | ||
* | ||
* @package MITlib_Child | ||
* @since 1.0.2 | ||
*/ | ||
|
||
namespace Mitlib\Child; | ||
|
||
$interviewee_params = array( | ||
'posts_per_page' => -1, | ||
'post_type' => 'interviewee', | ||
'post_status' => 'publish', | ||
'meta_key' => 'sort-name', | ||
'orderby' => 'sort-name', | ||
'order' => 'ASC', | ||
); | ||
$interviewees = new \WP_Query( $interviewee_params ); | ||
|
||
$interview_params = array( | ||
'post_type' => 'interview', | ||
'posts_per_page' => -1, | ||
'orderby' => 'post_date', | ||
'order' => 'ASC', | ||
'post_status' => 'publish', | ||
); | ||
$interviews = new \WP_Query( $interview_params ); | ||
?> | ||
|
||
<?php get_header( 'child' ); ?> | ||
|
||
<?php get_template_part( 'inc/breadcrumbs', 'child' ); ?> | ||
|
||
<div id="stage" class="inner" role="main"> | ||
|
||
<?php get_template_part( 'inc/title-banner' ); ?> | ||
|
||
<div id="content" class="content"> | ||
|
||
<div class="content-main main-content"> | ||
|
||
<?php if ( $interviewees->have_posts() ) { ?> | ||
|
||
<div class="entry-content"> | ||
<h1>Index of interviewees</h1> | ||
|
||
<div class="table"> | ||
<div class="table-row table-head"> | ||
<div class="table-cell"><span>Photo</span></div> | ||
<div class="table-cell"><span>Name</span></div> | ||
<div class="table-cell"><span>MIT affiliation</span></div> | ||
<div class="table-cell"><span>Music / professional work</span></div> | ||
<div class="table-cell"><span>Interview dates</span></div> | ||
</div> | ||
|
||
<?php | ||
while ( $interviewees->have_posts() ) { | ||
$interviewees->the_post(); | ||
$record_id = get_the_ID(); | ||
$interviewee_name = get_the_title(); | ||
$affiliation = get_field( 'mit-affiliation' ); | ||
$work = get_field( 'music-professional-work' ); | ||
?> | ||
|
||
<div class="table-row"> | ||
<div class="table-cell"> | ||
<?php | ||
if ( has_post_thumbnail() ) { | ||
echo '<span class="table-value-only">'; | ||
the_post_thumbnail( 'small' ); | ||
echo '</span>'; | ||
} else { | ||
echo '<span class="table-value-only null-image"> </span>'; | ||
} | ||
?> | ||
</div> | ||
<div class="table-cell"><span class="table-value-only record-title"><strong><?php the_title(); ?></strong></span></div> | ||
<div class="table-cell"><span class="table-label">MIT affiliation</span><span class="table-value"><?php echo esc_html( $affiliation ); ?></span></div> | ||
<div class="table-cell"><span class="table-label">Music / professional work</span><span class="table-value"><?php echo esc_html( $work ); ?></span></div> | ||
<div class="table-cell"> | ||
<span class="table-label">Interview dates</span> | ||
<?php | ||
if ( $interviews->have_posts() ) { | ||
echo '<ul class="table-value">'; | ||
while ( $interviews->have_posts() ) { | ||
$interviews->the_post(); | ||
$interview_title = get_the_title(); | ||
if ( str_contains( $interview_title, $interviewee_name ) ) { | ||
echo '<li><a href="' . esc_url( get_permalink() ) . '">'; | ||
echo get_the_date( 'n/j/Y' ); | ||
echo '</a></li>'; | ||
} | ||
}; | ||
echo '</ul>'; | ||
}; | ||
?> | ||
</div> | ||
</div> | ||
<?php } ?> | ||
</div> <!-- end div.table --> | ||
|
||
</div> <!-- end div.entry-content --> | ||
|
||
<?php } ?> | ||
</div> | ||
|
||
</div> | ||
|
||
</div> | ||
|
||
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
.table { | ||
display: table; | ||
|
||
.table-head { | ||
font-weight: bold; | ||
} | ||
|
||
.table-row { | ||
display: table-row; | ||
|
||
.table-cell { | ||
border-bottom: 1px solid #ddd; | ||
display: table-cell; | ||
vertical-align: top; | ||
|
||
.table-label { | ||
display: none; | ||
} | ||
|
||
img { | ||
height: auto; | ||
max-width: 100px; | ||
width: 100px; | ||
} | ||
|
||
span { | ||
display: block; | ||
margin: 10px 20px 10px 10px; | ||
|
||
&.null-image { | ||
height: 100px; | ||
} | ||
|
||
&.record-title { | ||
font-size: 18px; | ||
} | ||
} | ||
|
||
ul { | ||
margin: 10px 20px 10px 10px; | ||
|
||
li { | ||
margin: 0; | ||
list-style: none; | ||
|
||
&:before { | ||
content: " "; | ||
font-family: FontAwesome; | ||
color: #338bc5; | ||
font-size: 12px; | ||
margin-left: -12px; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&:nth-child(even) { | ||
background-color: #f2f2f2; | ||
} | ||
} | ||
} | ||
|
||
|
||
@media (max-width: 768px) { | ||
.table { | ||
display: block; | ||
|
||
.table-head { | ||
display: none; | ||
} | ||
|
||
.table-row { | ||
border-bottom: 1px solid #676767; | ||
display: block; | ||
padding: 15px 0; | ||
|
||
.table-cell { | ||
border-bottom: none; | ||
display: flex; | ||
|
||
.table-label { | ||
display: block; | ||
font-weight: bold; | ||
width: 33%; | ||
} | ||
|
||
|
||
.table-value { | ||
width: 66%; | ||
} | ||
|
||
.table-value-only { | ||
margin-left: 33%; | ||
padding-left: 20px; | ||
width: 66%; | ||
} | ||
|
||
ul li:before { | ||
margin-left: 0; | ||
} | ||
} | ||
|
||
&.table-head { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.