[Resolved] Variable random background image Page Headers

Home Forums Support [Resolved] Variable random background image Page Headers

Home Forums Support Variable random background image Page Headers

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #796785
    Tom
    Lead Developer
    Lead Developer

    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;
    } );
    #796817
    Paco Chorobo

    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

    #796859
    Tom
    Lead Developer
    Lead Developer

    Glad I was able to help! ๐Ÿ™‚

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.