• Resolved kevinwong

    (@kevinwong)


    Hi.

    I’ve been trying to customize Kubrick 1.6 for my own blog. Basically, i want it to look completely identical except with different header, footer and background images.

    I replaced kubrickbgwide.jpg, kubrickfooter.jpg and kubrickheader.jpg in the images folder with my own images and tried that. However, it didn’t work. I suspect it’s because of the script in Kubrick for changing the colour of the header. Simply replacing the images doesn’t stop the script from working, and therefore, even though i’ve replaced the images, the old gradient still shows up and breaks the page.

    Can anyone tell me how to achieve my objective? As i said, i’m not changing anything in kubrick. All the fonts and structural elements remain exactly as they are. I only want to change the images and switch the header with my own.

    Here’s what i’m trying to achieve:

    HERE

    Ignore the content for the moment

Viewing 10 replies - 1 through 10 (of 10 total)
  • You can delete the functions.php file found in kubrick’s folder – I justed tested this in 2.3.1 and it didn’t break anything. You will want to save a backup first – just in case.

    Thread Starter kevinwong

    (@kevinwong)

    Hi. Thanks. I did try that, though, and the result is the widgets in the side bar no longer work. I’ve been trying to figure out which parts of it are responsible for what function, but to no avail.

    oops, my bad – not used to these new-fangled widgets yet:) Create a new file named functions.php which contains the following code:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
        ));
    ?>

    Overwrite the default functions.php.

    This should work,
    -Mike

    Thread Starter kevinwong

    (@kevinwong)

    Thanks so much. I’ll give that a try ??

    Thread Starter kevinwong

    (@kevinwong)

    Hi. I tried it out and it worked. The widgets stayed. However, the page still didn’t look right. The header appears, but only on top of some other background colour, and meanwhile the middle background and the footer don’t appear at all.

    here

    Does anybody know how to remedy this?

    Hi. This is peculiar. I just executed all the steps above on a fresh install of 2.3.1 and it worked fine for me. It looks like your theme may have some customizations that result in invalid html and/or css… but this is hard to determine without a link to the site. You can see your new image appearing under a blue box with some text inside it. This is most likely what your css is telling it to do.

    Here is unaltered css from kubric:

    #header {
    	background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center;
    	}

    Notice this part: #73a0c5 – this is that blue color that you see. I would set it to ‘transparent’. I would then change the word ‘bottom‘ to ‘top‘. Note: the header img you uploaded in place of kubrickheader.jpg is only 40 pixels high – where the default kubrickheader.jpg is pixels 200 high. Since you image is much shorter then the original, and due to the fact that it is positioned to the bottom of it’s container, you are seeing the background color (#73a0c5) showing through where there is no image to cover it.

    Next Bit of code:

    #headerimg 	{
    	margin: 7px 9px 0;
    	height: 192px;
    	width: 740px;
    	}

    Notice the height part, this another reason you are seeing the blue box, #headerimg is contained within #header and has a height of 192 pixels set to it. I personally would delete the headerimg div from the html in header.php.

    Let me know how this works out and if you still have questions, please post a link to the live site.

    Thread Starter kevinwong

    (@kevinwong)

    Thanks.

    I tried what you suggested and it didn’t work, but then i went along with the logic and managed to figure out some of the problems.

    First of all the <style></style> in header.php

    <style type="text/css" media="screen">
    
    <?php
    // Checks to see whether it needs a sidebar or not
    if ( !$withcomments && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/<strong>kubrickbg-<?php bloginfo('text_direction'); ?>.jpg</strong>") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/bgwide.png") repeat-y top; border: none; }
    <?php } ?>
    
    </style>

    I failed to notice that.

    Also, there’s this in the style.css file:

    #header {
    	<strong>background-color: #73a0c5;</strong>
    	margin: 0 0 0 1px;
    	padding: 0;
    	<strong>height: 200px; </strong>
    	width: 758px;
    	}

    There was more. I’m going through everything line by line now. It’s tedious, but it’s working.

    Re: advice from mfields ‘Create a new file named functions.php which contains the following code:’

    Thank you soooo much. I tried this and it worked!
    I’ve been banging my head trying to get rid of the Kubrick header since I began my blog in January.

    I also changed my style.css to show:-

    h1 {
    	display: none;
    	font-size: 4em;
    	text-align: center;
    	}
    
    #headerimg .description {
    	display: none;
    	font-size: 1.2em;
    	text-align: center;

    You are just amazing – I can’t tell you how I’ve searched and searched, tried every darned thing. Thanks again.

    D’oh! Forgot to leave my blog address so that you can see my header.

    https://www.splodge-plog.com

    You can disable header-img.php under images folder.

    /*<?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);
    ?>
    */

    After the you’ll can customize the css file as you want. See sample https://shopping.inntell.com/

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘trouble customizing kubrick’ is closed to new replies.