Site logo

Archived topic

Variable random background image Page Headers

17 replies · Started by Paco Chorobo on November 28, 2018

Viewing posts 16–18 of 18

Ok, let's try this:

add_filter( 'generate_page_header_options', function( $options ) {
    if ( is_front_page() ) {
        $ids = array(
            '10',
            '12',
            '200'
        );

        $id = $ids[array_rand($ids)];

        $options['image_id'] = $id;
    }

    return $options;
} );

Master, let me say you are a f$%& genius. Congrats! Those guitars are showing off, aren't they? ;)

Thanks a lot, it looks amazing. Magnificent support as always. Thank you both for helping so much in this topic, and sorry for so much disturbing.

My very best regards from Spain,
Paco Chorobo

Glad I was able to help! :)

This archived topic is closed to new replies.