Figured it out using
First the location of the background image is stored in a string:
<?php $backimg = get_background_image(); ?>
Then perform a string and replace where the
.jpg is removed at the end of the
$backimg and is stored as
<?php $bgraw = str_replace('.jpg','',$backimg);?>
It output as:
The .jpg is removed; from there you insert the file you want to use. For example, I have a custom image where the dimensions are 1280px wide by 450px height. The image is created as fileimage.jpg-1280x450.jpg.
To use that image, take the stored value of
$bgraw and add
-1280x450.jpg or whatever file you want to use instead.
<?php echo $bgraw . '-1280x450.jpg' ;?>
That outputs as: