WordPress.org

Make WordPress Core

Ticket #14519: 14519-2.diff

File 14519-2.diff, 924 bytes (added by nickmomrik, 5 years ago)

Set the scheme to 'http' so there aren't different headers for http and https

  • twentyten/functions.php

     
    103103        // Your changeable header business starts here 
    104104        define( 'HEADER_TEXTCOLOR', '' ); 
    105         // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. 
    106         define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' ); 
    107105 
    108106        // The height and width of your custom header. You can hook into the theme's own filters to change these values. 
     
    176174                ) 
    177175        ) ); 
     176 
     177        // Use a consistent random default header 
     178        global $_wp_default_headers; 
     179        $header_names = array_keys( $_wp_default_headers ); 
     180        $header_key = crc32( site_url( '', 'https' ) ) % count( $_wp_default_headers ); 
     181        define( 'HEADER_IMAGE', $_wp_default_headers[$header_names[$header_key]]['url'] ); 
    178182} 
    179183endif;