function glm_get_background() {
if (has_post_thumbnail()) {
$image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
- $imageUrl = '<div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat scroll 0px 0px / cover;"></div>';
+ $imageUrl = "<div class='featured-image' style='background: url($image_data[0]) no-repeat scroll 0px 0px / cover;'></div";
} else {
$imageUrl = '';
}
if (has_post_thumbnail()) {
$image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
- echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px; "';
+ echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 300px; "';
} else {
//echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.gif);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;"';
echo ' class="no-featured"';
<?php get_header(); ?>
<main class="page-inside">
<div id="head-img">
- <?php echo glm_get_background(); ?>
+ <?php echo glm_get_header(); ?>
</div>
<div id="content-wrapper">
<div class="row">