get_random_header_image

Get random header image url from registered images in theme.

Description

(string) get_random_header_image(); 

Returns (string)

Path to header image


Usage

  1. if ( !function_exists( 'get_random_header_image' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_random_header_image(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/theme.php  
  1. function get_random_header_image() { 
  2. $random_image = _get_random_header_data(); 
  3. if ( empty( $random_image->url ) ) 
  4. return ''; 
  5. return $random_image->url;