The Studio Press Infinity Pro theme includes a filter for customizing which front page images can have background images configured through the WordPress customizer. This snippet, when added to the theme's /lib/helper-functions.php file, will allow you to add images to all of the front page widget areas.
If you don't want all widget areas to have background images, just remove the number from the array. The default is 1,3,5,7. One last step to finalize this, edit front-page.php and change the solid section class to image-section for any area to which you are adding an image.
Hi Victor,
Thank you for all you do! You’ve saved me on more than one occasion.
I’d like to apply your tutorial but in a slightly different way. Using Infinity Pro, I want to apply a background image to front-page-4 instead of front-page-3; so my background images would be
1,4,5,7,
instead of
1,3,5,7.
In my Infinity Pro child theme files, I didn’t find references to ‘infinity_images’, array( ‘1’, ‘3’, ‘5’, ‘7’ ) ) in
/lib/helper-functions.php.
However, I did find references to ‘infinity_images’, array( ‘1’, ‘3’, ‘5’, ‘7’ ) ) in
/lib/customize.php
as follows:
$images = apply_filters( ‘infinity_images’, array( ‘1’, ‘3’, ‘5’, ‘7’ ) );
and in /lib/output.php
as follows:
$opts = apply_filters( ‘infinity_images’, array( ‘1’, ‘3’, ‘5’, ‘7’ ) );
Would I change the array in both of the above?
And would I then change front-page.php by replacing .solid-section class to .image-section as follows:
genesis_widget_area( ‘front-page-4’, array(
‘before’ => ”,
‘after’ => ”,
) );
Thanks in advance.
Thank you Jamie. Always a pleasure working with you!
The Infinity Pro theme has changed a little since I wrote this article, but the principle is the same. What you want to do sounds right. I would go ahead and try it, but make backup copies of your files first in case anything goes wrong.