0

I've been working on a website using the twenty fifteen theme because the layout is almost the same as the client's wants.

But my problem is how can I change the full size background of the page for every page...

It is a multipage actually and not a one page website

Any help would be much appreciated..

  • Don't shout please. Please properly format your title – Pieter Goosen Apr 20 '16 at 8:25
  • Where does the full size background come from? There isn't one in the theme demo here. Did you mean the large image for the post, i.e. the boat? – Rup Apr 20 '16 at 9:18
  • No, I mean the background in the customize section..it gives me a full background..but the problem is I want to make a different background for every page – Kris18 Apr 20 '16 at 9:44
3

Twenty Fifteen has a hook for you to modify the custom background theme_support arguments (documentation for those arguments here):

// Setup the WordPress core custom background feature.
add_theme_support( 'custom-background',
    apply_filters( 'twentyfifteen_custom_background_args',
        array(
            'default-color'      => $default_color,
            'default-attachment' => 'fixed',
) ) );

You can implement this filter in your child theme's functions.php, e.g.

function wpse_224240_custom_background_args($args) {
    $args['default-image'] = get_stylesheet_directory_uri() . '/images/background.jpg';
    return $args;
}
add_filter( 'twentyfifteen_custom_background_args',
            'wpse_224240_custom_background_args' );

and add any extra logic you need to change the image there. For example if you want a specific different image per post then you could store that in post metadata and only set the 'default-image' if you have a different URL from metadata to use. If you wanted to pick a random one from a set you can do this here too, etc., either hard-coding the set or storing it as an option if you'd like it configurable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.