Resizing featured image used as page background
-
Hi! I’ve created a child theme of Twenty Fourteen (version 1.0) where I only show one post at a time, and the featured image is used as the page background.
This is my setup in home.php respectively single.php:
<style type="text/css"> body { background-image: url(<?php echo $imgURL ?>); background-repeat: no-repeat; background-size: 100% 25em; } </style>
I know it’s not an optimal solution at all, but it’s the only one I could think of. It does the job okay, but the image is usually stretched (especially when viewed on mobile) and I can’t figure out a way to make it scale appropriately without it either “falling below/underneath” the text block or pushing the post significantly down.
Can anybody help me?
Here’s the link to my page:
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Resizing featured image used as page background’ is closed to new replies.