WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] (kubrick) How do I change the 'header image and color' default size? (32 posts)

  1. mpm
    Member
    Posted 6 years ago #

    I have a custom kubrick header size but the 'header image and color' in the admin doesn't match the new size. Where/how do I adjust the sizes for the header colour picker stuff so that it does?

    I see that I should be looking in either functions.php or header-img.php but where exactly?

  2. MichaelH
    Member
    Posted 6 years ago #

    The Codex article, Designing Headers, should be of help.

  3. mpm
    Member
    Posted 6 years ago #

    Sorry mate, I didn't see anything there about adjusting Kubricks 'Header Image and Color' sizes. I should make it clearer that I'm not trying to make a custom header. I have just resized the normal kubrick header and would like to adjust the sizes in whatever controls the admin color picker.

  4. MichaelH
    Member
    Posted 6 years ago #

    How about wp-content/themes/default/functions.php for the WordPress 1.6 Default theme.

  5. mpm
    Member
    Posted 6 years ago #

    Hmm, yeah - I've been looking at that.

    But /what/ should I be looking at?

    I'm not having much luck google searching either - it's kind of surprising.

  6. billdennis5
    Member
    Posted 6 years ago #

    How about this: I need to turn off the header image color switch and use a personal header. I could do this easily when Kubrick came bundled without the color switcher. Now, I cannot get the personalheader.jpg to appear. There seems to be no settings in header.php to make the adjustment.

  7. mpm
    Member
    Posted 6 years ago #

    It's pretty straight forward. I have another blog which uses kubrick with a custom header and I just renamed my file with kubrickheader.jpg or whatever the default name is.

    There's plenty of documentaton on it anyway. A quick search and you'll be fine.

  8. billdennis5
    Member
    Posted 6 years ago #

    Well here the issue ... I'VE ALREADY DONE THIS. And the color picker is still up there instead of my custom image. It's driving me nuts.

  9. mpm
    Member
    Posted 6 years ago #

    Try hitting 'revert' on the presentation/headerandimagecolor/

  10. billdennis5
    Member
    Posted 6 years ago #

    Done. Then I clicked "Update header." Same thing. Same blank blue header instead of the lovely image I want to use.

  11. billdennis5
    Member
    Posted 6 years ago #

    OK. fixed it. I wasn't using the real Kubrick, but something called Kubrick Tabs. Now I've got it: http://peoriapundit.com/blogpeoria

  12. mpm
    Member
    Posted 6 years ago #

    Did you change the image ref (#header) in your style.css to the correct file name (you said you were trying to use personalheader.jpg)

    Did you check your header.php file?

  13. mpm
    Member
    Posted 6 years ago #

    I see you've worked it out now. Good stuff.

    So anyway, back to my problem - how do I adjust the size of the new header image that the color picker creates?

  14. Doodlebee
    Member
    Posted 6 years ago #

    Have you looked at your stylesheet (including the inline styles in the header.php file)?

  15. mpm
    Member
    Posted 6 years ago #

    I don't think the 'header image and color' switch/picker uses the stylesheet - at least, when I use CSS Viewer firefox extension it doesn't pick it up.

    I have looked at, and adjusted, the stylesheet for the default image header (and the rest of my modified theme).

  16. mpm
    Member
    Posted 6 years ago #

    I've still had no luck solving this...

  17. Doodlebee
    Member
    Posted 6 years ago #

    How 'bout instead of having us guess, you provide us with a link to the site in question? That might help you more.

  18. mpm
    Member
    Posted 6 years ago #

    I don't think I need to? I don't think that would help.

    I only want to know how to adjust the image size that kubricks header color picker creates. It doesn't line up with my new header (which is just the same old blue kubrick header but with different dimensions).

  19. Doodlebee
    Member
    Posted 6 years ago #

    I don't think I need to? I don't think that would help.

    Well, good luck then.

  20. mpm
    Member
    Posted 6 years ago #

    This is the image created by the header color creator.

    http://web.aanet.com.au/mpm/header-img.jpg

    As you can now see it doesn't match the kubrickheader.jpg underneath.

    I would like to know what to change in either functions.php or header-img.php to make it match.

  21. mpm
    Member
    Posted 6 years ago #

    Okay, so I can make some changes through header-img.php but I'm flying blind and can't find any info on editing this file.

    Where do I change the position of the new image and what exactly do those numbers in the rounded corners array mean?

    <?php
    
    $img = 'kubrickheader.jpg';
    
    // If we don't have image processing support, redirect.
    if ( ! function_exists('imagecreatefromjpeg') )
    	die(header("Location: kubrickheader.jpg"));
    
    // Assign and validate the color values
    $default = false;
    $vars = array('upper'=>array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2'));
    foreach ( $vars as $var => $subvars ) {
    	if ( isset($_GET[$var]) ) {
    		foreach ( $subvars as $index => $subvar ) {
    			$length = strlen($_GET[$var]) / 3;
    			$v = substr($_GET[$var], $index * $length, $length);
    			if ( $length == 1 ) $v = '' . $v . $v;
    			$$subvar = hexdec( $v );
    			if ( $$subvar < 0 || $$subvar > 255 )
    				$default = true;
    		}
    	} else {
    		$default = true;
    	}
    }
    
    if ( $default )
    	list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 );
    
    // Create the image
    $im = imagecreatefromjpeg($img);
    
    // Get the background color, define the rectangle height
    $white = imagecolorat( $im, 15, 15 );
    $h = 182;
    
    // Define the boundaries of the rounded edges ( y => array ( x1, x2 ) )
    $corners = array(
    	0 => array ( 25, 734 ),
    	1 => array ( 23, 736 ),
    	2 => array ( 22, 737 ),
    	3 => array ( 21, 738 ),
    	4 => array ( 21, 738 ),
    	177 => array ( 21, 738 ),
    	178 => array ( 21, 738 ),
    	179 => array ( 22, 737 ),
    	180 => array ( 23, 736 ),
    	181 => array ( 25, 734 ),
    	);
    
    // Blank out the blue thing
    for ( $i = 0; $i < $h; $i++ ) {
    	$x1 = 19;
    	$x2 = 740;
    	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
    }
    
    // Draw a new color thing
    for ( $i = 0; $i < $h; $i++ ) {
    	$x1 = 20;
    	$x2 = 739;
    	$r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1;
    	$g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1;
    	$b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1;
    	$color = imagecolorallocate( $im, $r, $g, $b );
    	if ( array_key_exists($i, $corners) ) {
    		imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white );
    		list ( $x1, $x2 ) = $corners[$i];
    	}
    	imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color );
    }
    
    //die;
    header("Content-Type: image/jpeg");
    imagejpeg($im, '', 92);
    imagedestroy($im);
    ?>

    This is what I've ended up with so far!

    http://web.aanet.com.au/mpm/header-img2.jpg

  22. mpm
    Member
    Posted 6 years ago #

    Got there in the long run. Thanks anyway.

  23. goowealth
    Member
    Posted 6 years ago #

    My header image is still the same blue blob. I double checked the new image file is saved as the same kubrickheader.jpg filename in the correct /images directory as indicated in style.css

    I still don't understand why Presentation - > Header Image and Color in the Kubrick Tabs is still not showing up the new image.

    I wonder how billdennis5 fixed the problem?

    The site is http://www.goowealth.com

    Any suggestions ? Thanks for helping.

    OK. fixed it. I wasn't using the real Kubrick, but something called Kubrick Tabs. Now I've got it: http://peoriapundit.com/blogpeoria

  24. billdennis5
    Member
    Posted 6 years ago #

    The problem was that I wasn't using the Default Theme, based on Kubrick. I was using a modification of the Kubrick theme, called Kubrick Tabs. Once I switched themes, I uploaded a new kubrickheader.jpg (that I designed myself) and the blue blob went away.

  25. goowealth
    Member
    Posted 6 years ago #

    Oh. Good for you the problem's solved.

    Well, i am using the current Default theme, neither overwriting kubrickheader.jpg nor pointing to a new filename in style.css is working...

    This is really a challenge. I mean what can be a logical explanation for this.

  26. kmessinger
    Volunteer Moderator
    Posted 6 years ago #

    Check which file you are overwriting. Should be ...\wordpress\wp-content\themes\default\images\kubrickheader.jpg

    Are you uploading it to the server? Several times I have changed something, checked and nothing happened and after 10 minutes of fishing around remembered, duh - I didn't upload it - just changed it on my end. :^)

    Of course, at my age, I don't have many brain cells left.

  27. mpm
    Member
    Posted 6 years ago #

    If you've changed the file name check the beginning of header-img.php in the images folder.

    Also, check header.php as sometimes the header css is stored here.

  28. goowealth
    Member
    Posted 6 years ago #

    Yep thanks, Kmessinger and MPM, both the jpg and php files were checked and fine then.

    So my last resort to resolve 'The Case of The Missing New Kubrick Header' was documented here:-

    http://wordpress.org/support/topic/136311

    Ad
    goowealth.com

  29. goowealth
    Member
    Posted 6 years ago #

    However, my widget changes are not updating. Some changes takes minutes, some hours, and some are determined not to.

    I deactivated wp-cache to see how it goes....

  30. sarahlove
    Member
    Posted 6 years ago #

    Hello... I have been having the same problem after changing the style.css file and header.php file for my default-theme blog. My new header image does not show. I've read that some problems with this WordPress theme are caused by plug-ins, and that the functions.php file with this theme basically acts as a plug-in. Therefore I suspect that the problem resides with the functions.php file. I'm going to find out what editions to this file I might be able to make in effort to solve this new-header problem and will post any information I can find.

Topic Closed

This topic has been closed to new replies.

About this Topic