Customizing the Background Image in Metro Pro from StudioPress

Sometimes a theme has too much control over the design you have in mind.

The popular Metro Pro theme from StudioPress uses the Backstretch jQuery plugin to manipulate the background image, stretching it full-size across the entire background. This means that the Display Options (Position, Repeat, Attachment) for Background under the Appearance menu or in the theme Customizer may be visible but have no effect – you can’t use a tiled background image.

To enable these controls and use a tiled background image we need to make some minor adjustments in functions.php.

Find these code blocks in functions.php that invoke Backstretch and delete or comment-out these lines. In the virgin file (version 2.0.1) these are located at lines 25 – 48:

Find this code block in functions.php that initially sets up the custom background. In the virgin file (version 2.0.1) these are located at lines 56-57. Delete or comment-out the original line 56 and add the code in line 57:

This restores “normal” handling options for the background image. In the theme Customizer or at Settings > Background the options for Position, Repeat and Attachment now allow control over these aspects.