WordPress.org

Support

Support » Themes and Templates » How to avoid random images header ?

How to avoid random images header ?

  • Hi all !
    I’m using Twenty Eleven theme and i would like to change “randomized images” header in “sequenced images” but it doesn’t works…
    I’ve tried to change it in functions.php :

    // By leaving empty, we allow for random image rotation.
    	define( 'HEADER_IMAGE', '' );

    in

    // By leaving empty, we allow for random image rotation.
    	define( 'HEADER_IMAGE', '7' );

    but it doesn’t works…

    also tried

    // Turn on random header image rotation by default.
    	add_theme_support( 'custom-header', array( 'random-default' => 'true' ) );

    in

    // Turn on random header image rotation by default.
    	add_theme_support( 'custom-header', array( 'random-default' => 'false' ) );

    Thanks for helping

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    @esmi

    Forum Moderator

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

    Create a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

    I can’ find anything in the codex that documents the parameters available with ‘custom-header’. But I was just trying to get my theme (which started with Twenty Eleven code) to both allow random images, but not make that the default behavior. But that needed a default image defined then. Here’s what worked to do that:

    // The %s is a placeholder for the theme template directory URI.
    define( 'HEADER_IMAGE', '%s/images/headers/default-header.jpg' );
    ...
    add_theme_support( 'custom-header'); // , array( 'random-default' => true ) );

    Killing the ‘random-default’ parameter seems to leave the random option still there, but lets one specify a default header. The header is not checked in the list (there is no radio button selected in this case), but the Header panel still works.

    Sorry – don’t know what “sequenced images” are, but thought this might help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to avoid random images header ?’ is closed to new replies.