Skip to content

Commit

Permalink
Merge branch 'rc-v1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cjg89 committed May 17, 2018
2 parents 3fefb25 + 38daf85 commit 4398af2
Show file tree
Hide file tree
Showing 30 changed files with 9,130 additions and 245 deletions.
149 changes: 29 additions & 120 deletions dev/acf-fields.json → dev/acf-export.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@
"header-media-default": "Default (525px)",
"header-media-fullscreen": "Fullscreen"
},
"default_value": [

],
"default_value": [],
"allow_null": 1,
"multiple": 0,
"ui": 0,
Expand Down Expand Up @@ -766,8 +764,8 @@
"placeholder": ""
},
{
"key": "field_5953ae3fb95bc",
"label": "Office Hours",
"key": "field_5afc3edf979e3",
"label": "About\/Description",
"name": "",
"type": "tab",
"instructions": "",
Expand All @@ -782,133 +780,46 @@
"endpoint": 0
},
{
"key": "field_5953ae5bb95bd",
"label": "Monday",
"name": "person_office_hours_m",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5953ae80b95be",
"label": "Tuesday",
"name": "person_office_hours_tu",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5953ae9eb95bf",
"label": "Wednesday",
"name": "person_office_hours_w",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5953aea9b95c0",
"label": "Thursday",
"name": "person_office_hours_th",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5953aeb6b95c1",
"label": "Friday",
"name": "person_office_hours_f",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5953aec7b95c2",
"label": "Saturday",
"name": "person_office_hours_sa",
"type": "text",
"instructions": "",
"key": "field_5afc3f63979e5",
"label": "Show Description Heading",
"name": "person_display_desc_heading",
"type": "true_false",
"instructions": "When enabled, a heading (<code>h2<\/code>) will be displayed above this person's description (post content).",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
"message": "",
"default_value": 1,
"ui": 0,
"ui_on_text": "",
"ui_off_text": ""
},
{
"key": "field_5953aed7b95c3",
"label": "Sunday",
"name": "person_office_hours_su",
"key": "field_5afc3f00979e4",
"label": "Description Heading Text",
"name": "person_desc_heading",
"type": "text",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"instructions": "Text to display in the heading immediately above this person's description (post content). If the \"Show Description Heading\" checkbox is disabled, this text will not be displayed.",
"required": 0,
"conditional_logic": [
[
{
"field": "field_5afc3f63979e5",
"operator": "==",
"value": "1"
}
]
],
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"default_value": "Biography",
"placeholder": "",
"prepend": "",
"append": "",
Expand Down Expand Up @@ -1063,9 +974,7 @@
"post_type": [
"person"
],
"taxonomy": [

],
"taxonomy": [],
"filters": [
"search",
"taxonomy"
Expand Down
4 changes: 2 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<h2 class="h5 text-primary mb-2 text-transform-none"><?php echo get_sitename_formatted(); ?></h2>
<?php echo get_contact_address_markup(); ?>
<?php
if ( class_exists( 'UCF_Social_Common' ) ) {
echo UCF_Social_Common::display_social_icons( array( 'color' => 'grey' ) );
if ( shortcode_exists( 'ucf-social-icons' ) ) {
echo do_shortcode( '[ucf-social-icons color="grey"]' );
}
?>
</section>
Expand Down
12 changes: 6 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ function get_media_background_picture( $srcs ) {
?>
<picture class="<?php echo $picture_classes; ?>">
<?php if ( isset( $srcs['xl'] ) ) : ?>
<source class="media-background object-fit-cover" srcset="<?php echo $srcs['xl']; ?>" media="(min-width: 1200px)">
<source srcset="<?php echo $srcs['xl']; ?>" media="(min-width: 1200px)">
<?php endif; ?>

<?php if ( isset( $srcs['lg'] ) ) : ?>
<source class="media-background object-fit-cover" srcset="<?php echo $srcs['lg']; ?>" media="(min-width: 992px)">
<source srcset="<?php echo $srcs['lg']; ?>" media="(min-width: 992px)">
<?php endif; ?>

<?php if ( isset( $srcs['md'] ) ) : ?>
<source class="media-background object-fit-cover" srcset="<?php echo $srcs['md']; ?>" media="(min-width: 768px)">
<source srcset="<?php echo $srcs['md']; ?>" media="(min-width: 768px)">
<?php endif; ?>

<?php if ( isset( $srcs['sm'] ) ) : ?>
<source class="media-background object-fit-cover" srcset="<?php echo $srcs['sm']; ?>" media="(min-width: 576px)">
<source srcset="<?php echo $srcs['sm']; ?>" media="(min-width: 576px)">
<?php endif; ?>

<?php if ( isset( $srcs['xs'] ) ) : ?>
<source class="media-background object-fit-cover" srcset="<?php echo $srcs['xs']; ?>" media="(max-width: 575px)">
<source srcset="<?php echo $srcs['xs']; ?>" media="(max-width: 575px)">
<?php endif; ?>

<img class="media-background object-fit-cover" src="<?php echo $srcs['fallback']; ?>" alt="">
Expand All @@ -132,7 +132,7 @@ function get_media_background_picture( $srcs ) {
function get_media_background_video( $videos, $loop=false ) {
ob_start();
?>
<video class="hidden-xs-down media-background media-background-video object-fit-cover" autoplay muted <?php if ( $loop ) { ?>loop<?php } ?>>
<video class="hidden-xs-down media-background media-background-video object-fit-cover" autoplay muted playsinline <?php if ( $loop ) { ?>loop<?php } ?>>
<?php if ( isset( $videos['webm'] ) ) : ?>
<source src="<?php echo $videos['webm']; ?>" type="video/webm">
<?php endif; ?>
Expand Down
93 changes: 63 additions & 30 deletions includes/header-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,48 @@ function get_header_videos( $post ) {
/**
* Returns title text for use in the page header.
**/
function get_header_title( $post ) {
function get_header_title( $obj ) {
$title = '';

if ( is_front_page() ) {
$title = get_field( 'homepage_header_title', $post->ID );
if ( is_home() || is_front_page() ) {
$title = get_field( 'homepage_header_title', $obj->ID );

if ( ! $title ) {
$title = get_bloginfo( 'name' );
}
}
else if ( is_404() ) {
$title = '404 Not Found';
elseif ( is_search() ) {
$title = __( 'Search Results for:' );
$title .= ' ' . esc_html( stripslashes( get_search_query() ) );
}
else if ( $post->post_type === 'person' ) {
$title = get_theme_mod_or_default( 'person_header_title' ) ?: get_field( 'page_header_title', $post->ID );
}
else {
$title = get_field( 'page_header_title', $post->ID );
elseif ( is_404() ) {
$title = __( '404 Not Found' );
}
elseif ( is_single() || is_page() ) {
if ( $obj->post_type === 'person' ) {
$title = get_theme_mod_or_default( 'person_header_title' ) ?: get_field( 'page_header_title', $obj->ID );
}

if ( !$title ) {
// Fall back to the post title
$title = $post->post_title;
if ( ! $title ) {
$title = single_post_title( '', false );
}
}
elseif ( is_category() ) {
$title = __( 'Category Archives:' );
$title .= ' ' . single_term_title( '', false );
}
elseif ( is_tag() ) {
$title = __( 'Tag Archives:' );
$title .= ' ' . single_term_title( '', false );
}
elseif ( is_tax() ) {
$tax_name = '';
$tax = get_taxonomy( $obj->taxonomy );
if ( $tax ) {
$tax_name = $tax->labels->singular_name . ' ';
}
$title = __( $tax_name . 'Archives:' );
$title .= ' ' . single_term_title( '', false );
}

return $title;
Expand All @@ -132,14 +155,16 @@ function get_header_title( $post ) {
/**
* Returns subtitle text for use in the page header.
**/
function get_header_subtitle( $post ) {
function get_header_subtitle( $obj ) {
$subtitle = '';

if ( $post->post_type === 'person' ) {
$subtitle = get_theme_mod_or_default( 'person_header_subtitle' ) ?: get_field( 'page_header_subtitle', $post->ID );
}
else {
$subtitle = get_field( 'page_header_subtitle', $post->ID );
if ( is_single() || is_page() ) {
if ( $obj->post_type === 'person' ) {
$subtitle = get_theme_mod_or_default( 'person_header_subtitle' ) ?: get_field( 'page_header_subtitle', $obj->ID );
}
else {
$subtitle = get_field( 'page_header_subtitle', $obj->ID );
}
}

return $subtitle;
Expand Down Expand Up @@ -368,17 +393,21 @@ function get_header_media_markup( $post, $videos=null, $images=null ) {
/**
* Returns the default markup for page headers.
**/
function get_header_default_markup( $post ) {
$title = get_header_title( $post );
$subtitle = get_header_subtitle( $post );
$extra_content = get_field( 'page_header_extra_content', $post->ID );
function get_header_default_markup( $obj ) {
$title = get_header_title( $obj );
$subtitle = get_header_subtitle( $obj );
$extra_content = '';

if ( is_single() || is_page() ) {
$extra_content = get_field( 'page_header_extra_content', $obj->ID );
}

ob_start();
?>
<div class="container">
<?php
// Don't print multiple h1's on the page for person templates
if ( $post->post_type === 'person' ):
if ( is_single() && $obj->post_type === 'person' ):
?>
<strong class="h1 d-block mt-3 mt-sm-4 mt-md-5 mb-3"><?php echo $title; ?></strong>
<?php else: ?>
Expand All @@ -399,16 +428,20 @@ function get_header_default_markup( $post ) {


function get_header_markup() {
global $post;
echo get_nav_markup( $post );
$videos = $images = null;
$obj = get_queried_object();

if ( is_single() || is_page() ) {
$videos = get_header_videos( $obj );
$images = get_header_images( $obj );
}

$videos = get_header_videos( $post );
$images = get_header_images( $post );
echo get_nav_markup();

if ( $videos || $images ) {
echo get_header_media_markup( $post, $videos, $images );
echo get_header_media_markup( $obj, $videos, $images );
}
else {
echo get_header_default_markup( $post );
echo get_header_default_markup( $obj );
}
}
Loading

0 comments on commit 4398af2

Please sign in to comment.