Is there a plugin to predefine default background for the user to choose from?

Hi

Is there any theme or plugin that extends the custom background functionality of wordpress, to allow presenting some default choices for backgrounds, just like the custom header does? In the custom header, you can define an array of default images to choose from, but there is no such thing for the backgrounds, which would be useful for multisite.

Is there anything like that available in your themes or plugins?

Thank you

Mário

  • offcourse
    • WPMU DEV Initiate

    Hi

    This is the place where I would like to replicate the header behaviour.

    This is what we achieve with this code:

    //Set some custom header images, add as many as you like
    //%s is a placeholder for your theme directory
    $customHeaders = array (
    //Image 1
    'wheel' => array (
    'url' => '/wp-content/themes/child4/header/img_mcs_1.jpg',
    'thumbnail_url' => '/wp-content/themes/child4/header/thumbnails/img_mcs_1.jpg',
    'description' => __( 'Car Wheel', 'customisetheme' )
    ),
    //Image 2
    'road' => array (
    'url' => '/wp-content/themes/child4/header/img_mcs_2.jpg',
    'thumbnail_url' => '/wp-content/themes/child4/header/thumbnails/img_mcs_2.jpg',
    'description' => __( 'Open Road', 'customisetheme' )
    ),
    //Image 3
    'keys' => array (
    'url' => '/wp-content/themes/child4/header/img_mcs_3.jpg',
    'thumbnail_url' => '/wp-content/themes/child4/header/thumbnails/img_mcs_3.jpg',
    'description' => __( 'Your New Keys', 'customisetheme' )
    ),
    //Image 4
    'cars' => array (
    'url' => '/wp-content/themes/child4/header/img_mcs_4.jpg',
    'thumbnail_url' => '/wp-content/themes/child4/header/thumbnails/img_mcs_4.jpg',
    'description' => __( 'All My Cars', 'customisetheme' )
    )
    );
    //Register the images with WordPress
    register_default_headers($customHeaders);
    }

    From what I read, the custom header function is ready for this with the “register_default_headers” function but nothing similar exists for backgrounds.

    My question is if there is a way to achieve the same result with the background, allowing users to choose one of the suggested textures as their website background image.

  • offcourse
    • WPMU DEV Initiate

    Thanks for all this.

    Just out of curiosity, as I am not an experienced programmer, is it a logical approach to look into the code of the core functions of wordpress and replicate it in some way?

    Something I would also like to use in other places would be the cropping feature of the header, so if this was something logical, I would try to dig into that as well.

    What are your thoughts on this?

  • offcourse
    • WPMU DEV Initiate

    Hi

    Well, I’m not really a coder so I am looking for the easiest way to do it the way I want, which doesn’t come easy…

    It’ll hake me a bit of time to get it right, so don’t hold your breath.

    My vision is to stay as close to the core functionality as possible, to make it easier to evolve my themes as WordPress evolves too. So I need to dig a bit more to try to get it done within the core background feature, or by extending it.

    Thanks for paying attention

    Cheers.

    Mario

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.