[theme-reviewers] custom admin area preview

Ian Stewart ian at themeshaper.com
Tue Oct 12 13:07:45 UTC 2010


On Mon, Oct 11, 2010 at 11:42 PM, A. Mignolo <amignolo at gmail.com> wrote:
> "Custom Header - the preview dimensions should probably be given greater
> height in the Custom Header admin page. Long Title/Description? currently
> over-run the text beneath."
>
> I'd like to either a) change the dimensions of the preview area or b)
> structure the preview to reflect exactly how it looks in the theme. In the
> admin preview area, the text is on top of the image, but in Oulipo the text
> is below the image. I've looked around for resources on how to handle this
> but haven't had much luck.

The custom header admin page preview markup/style can be altered by
adding a third parameter to add_custom_image_header(), for the
$admin_image_div_callback.

Basically, create a function like

function my_admin_header_image() { ?>
    <div id="headimg">
        <?php
        if ( 'blank' == get_theme_mod( 'header_textcolor',
HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor',
HEADER_TEXTCOLOR ) )
            $style = ' style="display:none;"';
        else
            $style = ' style="color:#' . get_theme_mod(
'header_textcolor', HEADER_TEXTCOLOR ) . ';"';
        ?>
        <h1><a id="name"<?php echo $style; ?> onclick="return false;"
href="<?php bloginfo( 'url' ); ?>"><?php bloginfo( 'name' );
?></a></h1>
        <div id="desc"<?php echo $style; ?>><?php bloginfo(
'description' ); ?></div>
        <img src="<?php esc_url ( header_image() ); ?>" alt="" />
    </div>
<?php }

and add 'my_admin_header_image' as the third parameter.

I hope that helps!

Ian


More information about the theme-reviewers mailing list