I am using backstretch.js to set a featured image as a full size background image (as per this tutorial).
I would like to combine this approach with different thumbnail sizes in order to reduce loading time on mobile devices. I am wondering how I can manage this.
I guess the deciding line of code is the following from functions.php:
wp_localize_script( 'backstretch-set', 'BackStretchImg', array( 'src' => wp_get_attachment_url( get_post_thumbnail_id() ) ) );
I know that I can combine this code with an image size, like
wp_get_attachment_url( get_post_thumbnail_id(), 'medium' ) ) );
But I don't know how to combine this either with mediaqueries or an if-query. Do you have an idea?