• Resolved koedel

    (@koedel)


    I love the home page of this theme, but most of my pages need a white background rather than the dramatic image that’s the background of the home page. Is there a simple way to prevent the background image from loading on pages? With all of the page templates, I get a flash of the background image as the page is loading before it fills in with the white background. I would like to keep the navigation bar on the pages. I know I probably need to make a custom page template, but I don’t know how to override having the background image load and still keep the navigation bar.
    I wish I had studied web design in school, but there was no internet when I was in school πŸ™‚

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter koedel

    (@koedel)

    Can I add an “if is home” type of filter to this part of the functions.php? Help with the code would be much appreciated.

    // Setup the WordPress core custom background feature.

    add_theme_support(‘custom-background’, apply_filters(‘zerif_custom_background_args’, array(

    ‘default-color’ => ‘ffffff’,

    ‘default-image’ => get_stylesheet_directory_uri() . “/images/bg.jpg”,

    )));

    Thread Starter koedel

    (@koedel)

    This works!!

    // Setup the WordPress core custom background feature.
    is_front_page(
    add_theme_support(‘custom-background’, apply_filters(‘zerif_custom_background_args’, array(

    ‘default-color’ => ‘ffffff’,

    ‘default-image’ => get_stylesheet_directory_uri() . “/images/bg.jpg”,

    ))));

    Thread Starter koedel

    (@koedel)

    No it didn’t work πŸ™

    Hi,

    It’s a small issue with the way stylesheet loads, and I’ve alert our team about this issue. We will try to release an update soon with this fix. πŸ™‚

    Regards,
    Hardeep

    joopworst

    (@joopworst)

    I have the same problem πŸ™ Do have any idea if this issue is resolved yet?

    Thread Starter koedel

    (@koedel)

    I was able to do a work around by installing a plugin that controls backgrounds. I’ve forgotten the name of it, but a search will find one. I’m using a different theme now. Good luck!

    IceOmny

    (@iceomny)

    Hi @koedel, can u plz tell me how to put bacground images on pages? it can be the same or different one from the homeplage… im trying to figure this out, and i posted a topic here but with no replay till now :(… im kinda lost… and i need it for a project at Uni

    WPShout

    (@codeinwp)

    Hi,

    Do you have the latest version of the theme? Because we thought we fixed this.
    If so, can you please give us a link to your site to see the problem?

    Thank you,
    Rodica

    Navin Nagpal

    (@navin-nagpal)

    Hi

    I am facing a similar problem. Kindly release a fix soon. You could check out the issue here – http://innerrealmcoaching.com/beginnings/

    I am using the latest version of the theme

    Navin Nagpal

    (@navin-nagpal)

    I have used the following code in functions.php and it seems to be working well –

    add_theme_support(‘custom-background’, apply_filters(‘zerif_custom_background_args’, array(

    ‘default-color’ => ‘ffffff’,

    ‘default-image’ => get_stylesheet_directory_uri() . “/images/bg.jpg”,

    ‘wp-head-callback’ => ‘check_if_landing_page’

    )));

    function check_if_landing_page(){

    if ( is_front_page() )
    {
    _custom_background_cb();
    }
    }

    WPShout

    (@codeinwp)

    Hi Navin,

    What version are you using? I see that you use a child theme. Is it possible that you did some changes in the child theme, that interferes with Zerif Lite?

    Regards,
    Rodica

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Avoid having background image load on pages’ is closed to new replies.