Skip to content

Commit

Permalink
fixing array to string conversions in template files
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaple committed Jun 21, 2019
1 parent b6999eb commit d799f8c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion inc/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function get_uw_breadcrumbs()
{

global $post;
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
$ancestors = array_reverse( get_post_ancestors( $post ) );
$html = '<li><a href="http://uw.edu" title="University of Washington">Home</a></li>';
$html .= '<li' . (is_front_page() ? ' class="current"' : '') . '><a href="' . home_url('/') . '" title="' . get_bloginfo('title') . '">' . get_bloginfo('title') . '</a><li>';

Expand Down
26 changes: 13 additions & 13 deletions templates/template-big-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*/
?>

<?php get_header();
<?php get_header();
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if(!$url){
$url = get_site_url() . "/wp-content/themes/uw-2014/assets/headers/suzzallo.jpg";
}
$mobileimage = get_post_meta($post->ID, "mobileimage");
$mobileimagesrc = get_post_meta($post->ID, "mobileimage");
$hasmobileimage = '';
if( !empty($mobileimage) && $mobileimage[0] !== "") {
$mobileimage = $mobileimage[0];
if( !empty($mobileimagesrc) && $mobileimagesrc[0] !== "") {
$mobileimage = $mobileimagesrc[0];
$hasmobileimage = 'hero-mobile-image';
}
$sidebar = get_post_meta($post->ID, "sidebar");
Expand All @@ -22,8 +22,8 @@


<div class="uw-hero-image hero-height <?php echo $hasmobileimage ?>" style="background-image: url(<?php echo $url ?>);">
<?php if( !empty($mobileimage) ) { ?>
<div class="mobile-image" style="background-image: url(<?php echo $mobileimage ?>);"></div>
<?php if( isset($mobileimage)) { ?>
<div class="mobile-image" style="background-image: url(<?php echo $mobileimage ?>);"></div>
<?php } ?>
<div id="hero-bg">
<div id="hero-container" class="container">
Expand All @@ -40,7 +40,7 @@
</div>

<div class="container uw-body">

<div class="row">

<div class="hero-content col-md-<?php echo (($sidebar[0]!="on") ? "8" : "12" ) ?> uw-content" role='main'>
Expand All @@ -55,15 +55,15 @@
<?php

// Start the Loop.
while ( have_posts() ) : the_post();
while ( have_posts() ) : the_post();


/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/

//the_content();
get_template_part( 'content', 'page-noheader' );

Expand All @@ -74,7 +74,7 @@
}

endwhile;

?>


Expand All @@ -87,12 +87,12 @@



<?php
<?php
if($sidebar[0]!="on"){ ?>
<div id="sidebar">
<?php get_sidebar(); ?>
</div> <?php
} ?>
</div> <?php
} ?>

</div>

Expand Down
12 changes: 6 additions & 6 deletions templates/template-small-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
if(!$url){
$url = get_site_url() . "/wp-content/themes/uw-2014/assets/headers/suzzallo.jpg";
}
$mobileimage = get_post_meta($post->ID, "mobileimage");
$mobileimagesrc = get_post_meta($post->ID, "mobileimage");
$hasmobileimage = '';
if( !empty($mobileimage) && $mobileimage[0] !== "") {
$mobileimage = $mobileimage[0];
if( !empty($mobileimagesrc) && $mobileimagesrc[0] !== "") {
$mobileimage = $mobileimagesrc[0];
$hasmobileimage = 'hero-mobile-image';
}
$sidebar = get_post_meta($post->ID, "sidebar");
Expand All @@ -22,9 +22,9 @@


<div class="uw-hero-image hero-height2 <?php echo $hasmobileimage ?>" style="background-image: url(<?php echo $url ?>);">
<?php if( !empty($mobileimage) && $mobileimage[0] !== "" ) { ?>
<div class="mobile-image" style="background-image: url(<?php echo $mobileimage ?>);"></div>
<?php } ?>
<?php if( isset($mobileimage)) { ?>
<div class="mobile-image" style="background-image: url(<?php echo $mobileimage ?>);"></div>
<?php } ?>

<div class="container">
<div id="hashtag" class="mask"><span><span><?php echo $banner[0] ? $banner[0] : ''; ?></span></span></div>
Expand Down

0 comments on commit d799f8c

Please sign in to comment.