adding bg cover and no repeat to the background iamges for posts and pages
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].'\')"></div>';
+ $imageUrl = '<div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat center center / cover"></div>';
} else {
- $imageUrl = '<div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/backgrounds/Default.jpg\')"></div>';
+ $imageUrl = '<div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/backgrounds/Default.jpg\') no-repeat center center /cover"></div>';
}
return $imageUrl;
}
<?php get_header(); ?>
- <div class="featured-image" style="background: url(<?php echo get_template_directory_uri(); ?>/assets/backgrounds/Default.jpg)"></div>
+ <div class="featured-image" style="background: url(<?php echo get_template_directory_uri(); ?>/assets/backgrounds/Default.jpg) no-repeat center center / cover"></div>
<main class="blog-home">
<div class="row">
<div class="small-11 small-centered columns">
<?php get_header(); ?>
-<div class="featured-image" style="background: url(<?php echo get_template_directory_uri(); ?>/assets/backgrounds/Default.jpg)"></div>
+<div class="featured-image" style="background: url(<?php echo get_template_directory_uri(); ?>/assets/backgrounds/Default.jpg) no-repeat center center / cover;"></div>
<main class="blog-single">
<div class="row">
<div id="blog-posts-over" class="small-12 medium-9 columns">