Hello,
I'm currently using a function inside my Functions.php which adds featured image of a post/page etc...as the background image.
function set_post_background() {
global $post;
$bgimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full");
if (!empty($bgimage)) {
return '<style type="text/css">body {background:#fff url('.$bgimage[0].') no-repeat top center;}</style>';
}
}
It works fine, but I don't always want the featured image to be the background image. Would it be possible to add a checkbox in the featured image page, which would enable/disable this function?
I'm not great at php, so any help would be much appreciated!