• Rhand

    (@rhand)


    I am using a customizable header made by the designer of the Connections Reloaded theme. I adjusted the with and height to fit my theme. All working well. I can change the color of the header title and tagline and upload a new image.
    There are some issues though… One, the header image of 1160px it is to big for the Dashboard Header Image configuration setting page. Two I would like to be able to change the padding of the title and tagline from the Dashboard Header Image admin as well. Anybody any tips how to adjust the code? Here is the code so far:

    // Custom Header
    define('HEADER_TEXTCOLOR', 'B5C09D');
    define('HEADER_IMAGE', '%s/images/header-pascal.jpg'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 1161);
    define('HEADER_IMAGE_HEIGHT', 350);
    define('HEADER_PADDING_TOP', 20);
    //define( 'NO_HEADER_TEXT', true );
    
    function header_style() {
    ?>
    <style type="text/css">
    #headimg{
    	background:#fff url(<?php header_image() ?>) no-repeat bottom;
    }
    <?php if ( 'blank' == get_header_textcolor() ) { ?>
    #headimg h1, #headimg #desc {
    	display: none;
    }
    <?php } else { ?>
    #headimg h1 a, #desc {
    	color:#<?php header_textcolor() ?>;
    }
    <?php } ?>
    </style>
    <?php
    }
    
    function crev_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg{
    	background:#fff url(<?php header_image() ?>) no-repeat bottom;
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width:<?php echo HEADER_IMAGE_WIDTH; ?>px;
    	padding:0;
    }
    
    #headimg h1{
    	margin: 0;
    	font-size: 1.6em;
    	padding:10px 20px 0 0;
    	text-align:right;
    }
    #headimg h1 a{
    	color:#<?php header_textcolor() ?>;
    	text-decoration:none;
    }
    
    #headimg #desc{
    	color:#<?php header_textcolor() ?>;
    	font-size: 1.4em; /*1.2em*/
    	text-align: left;
    	margin-left: 60px;
    	margin-top: -15px;
    }
    
    <?php if ( 'blank' == get_header_textcolor() ) { ?>
    #headimg h1, #headimg #desc {
    	display: none;
    	text-decoration:none;
    }
    #headimg h1 a, #headimg #desc {
    	color:#<?php echo HEADER_TEXTCOLOR ?>;
    }
    <?php } ?>
    
    </style>
    <?php
    }
    
    add_custom_image_header('header_style', 'crev_admin_header_style');
    
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Rhand

    (@rhand)

    Well I added this code:

    <?php if ( 'blank' == get_header_padding_top() ) { ?>
    #headimg h1, #headimg #desc {
    	padding-top: 0;
    }
    <?php } else { ?>
    #headimg h1 a, #desc {
    	padding-top:<?php header_padding_top() ?>px;
    }
    <?php } ?>

    but it broke the theme somehow..

    Thread Starter Rhand

    (@rhand)

    Well it’s not the PHP, but the CSS.. No PHP Errors..

    Thread Starter Rhand

    (@rhand)

    Is there nobody who has experience expanding the custom header image option?
    I know by reading http://codex.wordpress.org/Function_Reference/add_custom_image_header how the image is called for in admin. But I need knowledge how to add buttons for postioning the header title and title tag.

    Thread Starter Rhand

    (@rhand)

    Found out that get_header_image and get_header_textcolor are functions loaded fro theme.php in wp-includes. I would need to create my own function to load the padding settings.
    Will do some more research of my own as usual. Will keep all my dedicated readers posted.

    Bump- did you ever figure out how to display a custom function in your functions.php theme file to call this info?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Advanced Custom Header’ is closed to new replies.