I am customizing a wordpress plugin so that an image loading dynamically into the background of a div. I have the code for the image url as
$instance['imageurl'] which resolves to something like
http://url-here.../wp-content/uploads/2021/06/IMG_6227-copy.jpg
however, I'd like to alter this to add the same few characters in every instance, always just before the ".jpg" or whatever the file type may be, so that in this instance it would be
http://url-here.../wp-content/uploads/2021/06/IMG_6227-copy-519x416.jpg
How can I code this?
Here's the code in this section:
<a class="sal-feature" href="<?php echo $instance['link']?>"><div class="row sal-feature-wrap" style="background-repeat:no-repeat; background-size:100% auto; background-image: url('<?php echo $instance['imageurl']; ?>');">
Thanks for your help!