Custom background for the homepage only, WordPress?
-
I’m trying to work with theme options in WordPress. I made dynamic background image using
add_theme_support( ‘custom-background’, array(
‘wp-head-callback’ => ‘custom_background_cb’,
// Background color default
‘default-color’ => ‘fff’,
// Background image default
‘default-image’ => trailingslashit( get_template_directory_uri() ) . ‘images/bg.jpg’,
) );This work for me, but I want image only on homepage background, and on other pages only color. I tried something with
if ( is_front_page() )
{
custom_background_cb();
}but it doesn’t work. I need some other suggestions or solutions. Please help! Thank you.
- The topic ‘Custom background for the homepage only, WordPress?’ is closed to new replies.