Forums

[resolved] KubrickHeader.jpg replaced and function.php deleted (17 posts)

  1. mentor@deeyes
    Member
    Posted 8 months ago #

    Hello,
    I recently installed wordpress 2.7.1 with Kubrick template. I didn't want the standard blue header. I wanted to replace this with my own header. So, I followed an article that guided me how to replace the standard blue header with my own header. Part of the steps to do this, is to delete the 'functions.php' from inside the /wp-content/themes/default folder. But, when I do this, I am not able to use side bar to manage widgets or plugins. This is completely deactivated. I later found that, for the sidebar to function properly, I need to have the 'functions.php' file. So, if I have the functions.php file, the standard blue kubrick's header overlaps my custom header. That looks so odd. I am not a programmer at all. I can only follow what I am asked to do in programming. So, keeping this in mind, can someone guide me how to achieve this? I need to have my own custom header and also the sidebar to manage plugins / widgets. Any help here is highly appreciated.

    Thank you.
    Mentor@Deeyes

  2. stvwlf
    Member
    Posted 8 months ago #

    Hi

    You do need the functions.php file. If you do the best job you can putting the header back in place and then post the URL to your site, someone will help you finish the job. It really has to be seen to be able to help.

  3. mentor@deeyes
    Member
    Posted 8 months ago #

    Hello,

    Thank you for the prompt response. I will replace the functions.php and that will messup with the header (banner). Below is the url. If someone could look at it and help me with this, that would be really appreciated.

    http://www.deeyes.net

    Thank you.
    Mentor@Deeyes

  4. stvwlf
    Member
    Posted 8 months ago #

    Hi

    Your problem actually is very simple. In your header.php file around line 41 is this code

    <style type='text/css'>
    <!--#header { background: url('http://deeyes.net/wp-content/themes/default/images/header-img.php?upper=000055&lower=4180b6') no-repeat bottom center; }
    --></style>

    change it to this and things will work as you want

    <!--<style type='text/css'>
    #header { background: url('http://deeyes.net/wp-content/themes/default/images/header-img.php?upper=000055&lower=4180b6') no-repeat bottom center; }
    </style>-->

    The comment characters within a style block are /* */ and not the HTML comments - that CSS was being executed even though you thought it was commented out

  5. mentor@deeyes
    Member
    Posted 8 months ago #

    Hello Stvwlf,

    Thanks so much for your efforts to help me. I don't know what I am doing wrong here. For some reason, I don't see your reference codes in my 'header.php' file. for your information, I am looking at this location '\wordpress\wp-content\themes\default\header.php'. But, I don't see the lines you mentioned above in this file. For that matter, I don't see these lines anywhere at all in my header.php file. Where did you find these lines and what am I doing wrong and why don't I see those lines? Once again thank you so much for your help.

    UPDATE / CORRECTION:

    Yes, now I am able to see the lines that you have mentioned in your post when I do View --> Source from the IE browser screen. But, I don't see these lines if I open the header.php file directly. Where am I going wrong?

    Mentor@Deeyes

  6. stvwlf
    Member
    Posted 8 months ago #

    hi

    I'm sorry, I missed before that your theme is using a PHP trick - the reference is probably in header-img.php

  7. figaro
    Member
    Posted 8 months ago #

    See the following videos.

    http://educhalk.org/blog/?p=137

  8. mentor@deeyes
    Member
    Posted 8 months ago #

    I don't see a file named 'header-img.php', I see only 'image.php' but, I don't see these reference lines in that file either. Here is the bunch of codes I see in 'header.php' that is comparitively close to your reference codes. But, other than this, I don't see anything that is similar to your reference codes in 'header.php'. Thank you so much for your support.

    <style type="text/css" media="screen">
    
    <?php
    // Checks to see whether it needs a sidebar or not
    if ( !empty($withcomments) && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>
    
    </style>
    
    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="page">
    
    <div id="header">
    </div>
    <hr />
  9. mentor@deeyes
    Member
    Posted 8 months ago #

    Hi StvWlf,

    I did find 'header-img.php' inside the 'image' folder and that file doesn't contain your reference codes from 'View --> Source' from the browser. Please find below the content of 'header-img.php'.

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    /** @ignore */
    $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);
    ?>
  10. mentor@deeyes
    Member
    Posted 8 months ago #

    Hello Figaro,
    Thanks for trying to help me here. I did look at your link and watched your Video 3 of 3 from the link. As seen in your video, I went to 'header.php' but, I don't see any content inside the
    <div id="header> and </div> tags to delete. For your reference, I am quoting below the actual contents of my 'header.php' file. Please guide me here. Thanks once again for your help.

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <style type="text/css" media="screen">
    
    <?php
    // Checks to see whether it needs a sidebar or not
    if ( !empty($withcomments) && !is_single() ) {
    ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg-<?php bloginfo('text_direction'); ?>.jpg") repeat-y top; border: none; }
    <?php } else { // No sidebar ?>
    	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
    <?php } ?>
    
    </style>
    
    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="page">
    
    <div id="header">
    </div>
    <hr />
  11. stvwlf
    Member
    Posted 8 months ago #

    hi

    based on where that CSS is showing up in your header (View Source) it could be coming from the theme's function.php file or from a plugin. it IS in there someplace. I'd check function.php first.

    If you can't find it - do you have a Grep software? if so use it on the whole theme folder searching for #header { background: url('

  12. mentor@deeyes
    Member
    Posted 8 months ago #

    Hi StvWlf,

    You are awesome. Thank you so much. That fixed my problem. I found this reference code in function.php. I moved the comment tags a bit and that fixed my problem. Now, I am able to use the custom folder with the widget / sidebar. For yours and others reference I am quoting below the part of codes in which I found the comment tages before change and after change.

    Before Change

    function kubrick_head() {
    	$head = "<style type='text/css'>\n<!--";
    	$output = '';
    	if ( kubrick_header_image() ) {
    		$url =  kubrick_header_image_url() ;
    		$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
    	}
    	if ( false !== ( $color = kubrick_header_color() ) ) {
    		$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
    	}
    	if ( false !== ( $display = kubrick_header_display() ) ) {
    		$output .= "#headerimg { display: $display }\n";
    	}
    	$foot = "--></style>\n";
    	if ( '' != $output )
    		echo $head . $output . $foot;
    }

    After Change

    function kubrick_head() {
    	$head = "<!--<style type='text/css'>\n";
    	$output = '';
    	if ( kubrick_header_image() ) {
    		$url =  kubrick_header_image_url() ;
    		$output .= "#header { background: url('$url') no-repeat bottom center; }\n";
    	}
    	if ( false !== ( $color = kubrick_header_color() ) ) {
    		$output .= "#headerimg h1 a, #headerimg h1 a:visited, #headerimg .description { color: $color; }\n";
    	}
    	if ( false !== ( $display = kubrick_header_display() ) ) {
    		$output .= "#headerimg { display: $display }\n";
    	}
    	$foot = "</style>\n-->";
    	if ( '' != $output )
    		echo $head . $output . $foot;
    }

    Changes are made in the second line from top and third line from bottom. Once again thank you for saving my day.

    Mentor@Deeyes

  13. hannahcraner
    Member
    Posted 8 months ago #

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
    <?php wp_head(); ?>
    </head>
    <body>
    <div class="PageBackgroundGradient"></div><div class="PageBackgroundGlare"><div class="PageBackgroundGlareImage"></div></div>
    <div class="Main">
    
    <div class="Sheet">
      <div class="Sheet-body">
    <div class="Header">
      <div>
    <table class="logo">
    <tr><td class="logo-name"><h1><a href="<?php echo get_option('home'); ?>" title="<?php bloginfo('name'); ?>"><img src="<?php bloginfo('stylesheet_directory') ?>/images/Header.jpg" alt="<?php bloginfo('name'); ?>" /></a></h1></td></tr>
    <tr><td class="logo-text"><?php bloginfo('description'); ?></td></tr>
    </table>
    
      </div>
    </div>

    This is what I hate in my header.php (Hopefully this works...)

  14. alfh
    Member
    Posted 5 months ago #

    How to replace the Kubrick header image.

    I found a simpler solution (applies to WP 2.8 and hopefully previous versions as well:

    1. name your desired header image kubrickheader.jpg and replace the original in themes/default/images

    2. Find this line in header-img.php:

    if ( ! function_exists('imagecreatefromjpeg') )

    3. remove the exclamation mark:

    if (function_exists('imagecreatefromjpeg') )

    This tells the header-img.php to die if the image-creating function exists. Downside is that it will possibly create trouble if the function doesn't exist.

    Dear WP-developers: Pleas make it possible to upload your own image when you click "custom header"!

  15. Loreli
    Member
    Posted 5 months ago #

    Hi,

    I've tried watching the tutorial mentioned as well as following all the instructions given here. Nothing seems to be working. I'm using WordPress 2.8 and my site can be found here: http://www.aodstudios.com/reroll/

    As you can see, the head just wont appear.

    When I go into Appearance --> Custom Header it shows up just fine as the default. But all I'm getting on my page is the big blue space.

    Any help offered will be greatly appreciated.

    Thank you!

  16. sharathgrao
    Member
    Posted 4 months ago #

    function.imagejpeg not found showing in Google webmaster tools
    ------------------------------------------------------------------

    Hey guys i have a wordpress blog which runs on 2.8 and i use GOogle webmaster to manage my site and analyze. however i recently noticed (after upgrading to wordpress 2.8 i'm getting a high rate of domain.com/[posturl]/function.imagejpeg not found being caught in webmaster tools..........................

    Does any one else have the same issue?? plsss help someoneeeee

  17. questdj
    Member
    Posted 4 months ago #

    I just spent around 2 hours on the net, looking for a solution for this problem. This solved my problems with the default blue box appearing as the header, even after i deleted the header jpeg from the ftp.

    http://wordpress.org/support/topic/151749?replies=5

Reply

You must log in to post.

About this Topic

Tags

No tags yet.