Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to extend the Custom Header class to include an animation feature for the header graphics. Essentially, I'd like to add another possible value for the radio button for randomization. The existing code reads:

if ( 1 < count( $headers ) ) {
        echo '<div class="random-header">';
        echo '<label><input name="default-header" type="radio" value="random-' . $type . '-image"' . checked( is_random_header_image( $type ), true, false ) . ' />';
        echo __( '<strong>Random:</strong> Show a different image on each page.' );
        echo '</label>';
        echo '</div>';
    }

I would like to do something like this so you can toggle between random and animated. Default output would look something like this:

<div class="behavior-header">
<div class="default-header">
<label><input name="behavior-header" type="radio" value="none" checked />
<strong>None:</strong> No randomization or animation.</label>
</div>
<div class="random-header">
<label><input name="behavior-header" type="radio" value="random" />
<strong>Random:</strong> Show a different image on each page load.</label>
</div>
<div class="animate-header">
<label><input name="behavior-header" type="radio" value="animate" />
<strong>Animate:</strong> Display headers as slideshow.</label>
</div>
</div>

I have had no luck hooking into the custom_header_options (it just places any code into the end of the page, which does not allow for an either/or selection of none/random/animation). Anyone had any experience with extending the custom header class? Is there a simpler way to do this without extending the class?

I'm all ears :)

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.