WordPress.org

Ready to get started?Download WordPress

Forums

How to avoid random images header ? (3 posts)

  1. dex
    Member
    Posted 2 years ago #

    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

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  3. wpweaver
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic