173 Comments

  1. Posted May 30, 2009 at 7:34 am | Permalink

    Thanks!

  2. Posted June 1, 2009 at 6:42 pm | Permalink

    Thanks for the tip. Works smoothly

  3. Blanky McGee
    Posted June 5, 2009 at 11:48 pm | Permalink

    This is great! Thank you.

  4. Posted June 7, 2009 at 12:22 pm | Permalink

    Britain’s Got Talent ;-)

    Works a dream!

    Thanks!

  5. Posted June 8, 2009 at 12:55 pm | Permalink

    Thankyou for this, i copied the code accross and have the box displayed but dont seem to be able to get the image to view what have I done wrong?

    • Posted June 8, 2009 at 5:44 pm | Permalink

      In the back end, under the Child Theme Options panel, do you see the image you uploaded? If not, chances are you don’t have writing permissions for your uploads folder. To fix this try and go into your FTP client and give the uploads folder 777 permissions.

      If you don’t have a FTP client you can always use Filezilla. Here’s a quick tutorial for it: Filezilla 777 Tutorial. Let me know if this worked for you!

      • Posted June 19, 2009 at 5:39 am | Permalink

        Hi that didnt work, got a friend to have a look and there is something wrong with image uploading. He got it to work for other themes but i still can’t get it to work for thematic i have changed to a different theme for now.

      • Brenda
        Posted February 11, 2010 at 8:21 pm | Permalink

        Isn’t changing permissions to 777 a security risk? See this article: http://codex.wordpress.org/Changing_File_Permissions

        • Posted February 11, 2010 at 11:01 pm | Permalink

          Yes, 777 permissions are a security risk.

          Some servers won’t let you upload images if you don’t have 777 permissions. This means you won’t be able to use the media gallery from WordPress without these permissions on the /uploads folder.

          Only and only on the uploads directory should receive 777 permissions.

          To put it into perspective, if you can use the media gallery you will be able to use this script!

        • Brenda
          Posted February 12, 2010 at 4:44 am | Permalink

          Thanks for the response, Christian. My server seems to allow more restrictive permissions, and it’s all working, so I’m leaving it at that. I did have to modify the php with the @fopen and @fclose. Hope this is ok.

          Thanks for a great tool!

    • Posted June 20, 2009 at 8:18 am | Permalink

      Can you send me your login? I can’t really tell what’s wrong without looking at the code and site. You can use the contact form to send it.

  6. Posted June 10, 2009 at 3:03 pm | Permalink

    Is threaded comments available in commune? What are the upcoming features? Good job on the theme!

    • Posted June 10, 2009 at 3:13 pm | Permalink

      Yes, threaded comments are available. You just have to activate them in the WordPress back end, in the settings tab under conversations.

  7. marcie
    Posted June 12, 2009 at 8:40 am | Permalink

    Great for newbies to WordPress, like me…got this error after paste and trying to update:
    Parse error: syntax error, unexpected T_DNUMBER in /home1/menopau6/public_html/wp-content/themes/sugar_cane/functions.php on line 10

    • Posted June 13, 2009 at 2:55 pm | Permalink

      Normally this code should have worked out of the box.

      From what I can see you’re using the Sugar Cane Child Theme. It already has php code inside it’s functions.php file so try and check that all the

  8. Posted June 18, 2009 at 3:31 am | Permalink

    Ah! I tried to do this and it didn’t work… Now can’t even get to the page to fix it!

    Keeps saying: Parse error: syntax error, unexpected $end in /home/alexisgrant/alexisgrant.com/travelblog/wp-content/themes/thematic/functions.php on line 42

    Help!

    • Michael
      Posted June 18, 2009 at 4:01 am | Permalink

      Maybe something broken under the new WP 2.8 update? I modified functions.php, successfully loaded a header image, then got the following on logging out (and now I get this on login, and can’t get to the Admin/Dashboard page:

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-login.php on line 287

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-login.php on line 299

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-includes/pluggable.php on line 671

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-includes/pluggable.php on line 672

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-includes/pluggable.php on line 673

      Warning: Cannot modify header information – headers already sent by (output started at /homepages/3/d94931308/htdocs/populardelusions/wp-content/themes/thematic/functions.php:91) in /homepages/3/d94931308/htdocs/populardelusions/wp-includes/pluggable.php on line 865

      • Posted June 18, 2009 at 7:14 am | Permalink

        Check out to see if at the end of the functions.php file after the last php closing tag “?>” there aren’t any spaces or characters. That’s probably the reason the header information error is appearing.

        • Michael
          Posted June 19, 2009 at 6:57 pm | Permalink

          Doh! You’re right!

        • Posted July 14, 2009 at 10:22 am | Permalink

          Hey,.. I’d been trying to figure this out for an hour,.. a simple vacant line (line18) in functions.php was all I needed to delete…works perfect now (setting up RSS feed). Thanks Cristi

    • Posted June 18, 2009 at 7:19 am | Permalink

      @Alexis Grant – Check out this article about the php error you’re having: http://www.mydigitallife.info/2006/04/23/php-parse-error-syntax-error-unexpected-end/ Might give you a clue why the error is appearing.

  9. Posted July 1, 2009 at 8:05 pm | Permalink

    hi, i’m having the same problem as “melissa” (june 19th) – and working in thematic. i can’t seem to get an image to upload. nothing displays for “Current image:” and nothing shows up on the blog. i have tried redoing everything from scratch several times, and also made sure the uploads folder was given 777 permissions. can you explain to me how you resolved this problem?
    thanks!
    wu

    • Posted July 1, 2009 at 8:40 pm | Permalink

      Unfortunately we didn’t resolve the issue. I don’t know what the problem could be and I would need access to your wordpress account and to the ftp to debug this. If you can send this info over my contact form I can have a look tomorrow !

  10. Mike Miller
    Posted July 2, 2009 at 8:37 am | Permalink

    Yeah, I am having a problem with the actual display of the header as well. I may be missing something simple here, but it seems that the “adding the logo image to header” section is not executing, though I am not getting any errors. I can upload fine (directory is 777), the image is actually displayed in the Child Options section, but no go on the site itself. Actually, there is one weird thing, for some reason on the child theme options page, my logo is displayed at the top (where you actually upload the logo), but the basic default (Kubric) header is displayed underneath that under “Customize Header”..I am guessing that is not supposed to be like that?

    • Mike Miller
      Posted July 2, 2009 at 8:40 am | Permalink

      Nevermind, I am an idiot..well actually my excuse is that it is late (early?) here..I did not actually finish creating a full child theme..I will work on this some more tomorrow.

  11. Posted July 3, 2009 at 1:27 pm | Permalink

    Thanks! I had to make a small change to get it to work on Vista with PHP 5.

    The fread did not work so I replaced it with file_get_contents. The code is below for those interested. I commented out unused code.

    Thanks for the code!

    if($file_type==”image/gif” || $file_type==”image/jpeg” || $file_type==”image/pjpeg” || $file_type==”image/png”){
    /*$length=filesize($temp_file);*/
    $fd = fopen($temp_file,’rb’);
    $file_content=file_get_contents($temp_file);
    /*$file_content=fread($fd, $length);*/
    fclose($fd);

    • Posted July 3, 2009 at 1:45 pm | Permalink

      Cool! Thanks for the contribution!

      • Posted September 30, 2009 at 4:11 pm | Permalink

        Indeed file_get_contents() saves a lot of lines. You don’t need the other two lines either… drop the two lines for fopen() and fclose() as well. file_get_contents() does it all, and more efficiently (no need to go get the filesize first, for example).

  12. blackinches
    Posted July 22, 2009 at 8:55 am | Permalink

    thanks for the code. it works great. but i’m wondering if there is a way to make the logo centered once i upload the image.

    • Posted July 22, 2009 at 9:04 am | Permalink

      You need to style the div with the id ‘logo-image’ like this

      #logo-image{
      text-align:center;
      }

      This code you have to add into your child theme’s style.css

      Also to make it fit perfectly you can play with css padding like so
      #logo-image{
      padding:10px 20px 0px 50px;
      }

      Hope this helps!

  13. Kimberly
    Posted July 25, 2009 at 10:28 pm | Permalink

    Greetings Cristi: The code worked perfectly… until I logged out. I got the white screen of death when I logged back in. I deleted the header code from functions.php and was able to get back to my dashboard.

    I’ve made sure there are no characters after the php closing tag. I’m using WP 2.8.2. Is there a way to fix this?

  14. Posted July 29, 2009 at 10:29 am | Permalink

    OK, I got this to work today. Last night at midnight, I kept trying this and was ready to pull my hair out. Then this morning, I suddenly thought – “hey, he doesn’t say where to add the code.” I had been trying to stick it where I thought it should go (with absolutely no knowledge of why it might go there!) This morning, I just put it at the beginning and it works! You Rock!

    The only thing is that it will only accept my .gif file that has a white background. It won’t accept the transparant .gif and it won’t accept a .gif with a colored background to match the background of my header. What .gives with this? Why will it only accept the gif with the white background?

    Thanks!

    • Posted July 29, 2009 at 10:44 am | Permalink

      I’ve tested it with a transparent gif and a transparent png and it works just fine! Can you please check to see if you saved the gif correctly?

      • Posted July 29, 2009 at 11:01 am | Permalink

        You’re right. No idea why it’s working now. I tried it several times before and I’m doing nothing differently. I always save for web & devices via either photoshop or Illustrator. Been doing this a very long time.

        Thanks so much for your help! Can’t tell you how much I appreciate it. Please let me know if I can do something for you guys.

        • Posted July 29, 2009 at 11:12 am | Permalink

          I’m glad you sorted that out!

          As for what you can do for us? Just spreading the word about our themes or send a friend or colleague that needs custom web-design to us that would be great! Just don’t send them in the next two weeks as we’re off in vacation! :)

  15. Rachel
    Posted July 30, 2009 at 2:53 am | Permalink

    Thank you, this is a good tip.

    I have manually added img alt attributes and a titles to my functions.php but this can be fairly easily added as an option (or alternatively could call the blog description to use as alt?). Img alt attributes assist people who may not be able to see your images for a variety of reasons.

    • Posted July 30, 2009 at 7:56 am | Permalink

      You’re absolutely right. Thank you for the idea!

  16. Posted September 25, 2009 at 5:59 pm | Permalink

    Works well. Thanks for the tip.

  17. Posted September 30, 2009 at 7:27 pm | Permalink

    thank you for the excellent code sharing! i successfully added my logo with the above function, but there is a huge amount of white space that appears above it on the page. how can i get rid of this?

    thanks!

  18. Posted November 3, 2009 at 7:44 am | Permalink

    Hi Cristi,

    Thank you for the code – I created the child theme and then added the code to functions.php, and began getting this error immediately after saving:

    Parse error: syntax error, unexpected T_DNUMBER in /home/reddwarf/public_html/wp-content/themes/thematic/functions.php on line 3

    I can no longer access my theme editor – it just pops up with the same error. I have the most up to date version of WordPress. Any help would be appreciated!

    • Posted November 3, 2009 at 8:22 am | Permalink

      Were did you add the text? Inside thematic functions.php or inside your Child theme functions.php?

      If inside Thematic, delete and reupload Thematic. If not, connect to the FTP, download the functions.php file, empty it, and upload it back to your child theme. The problem is a syntax error (meaning you forgot a ‘;’ or didn’t put the < ? php ? > tags correctly).

      • Posted November 3, 2009 at 3:47 pm | Permalink

        I added the text within my Child Theme functions.php – thank you for the speedy response! I’ll follow your suggestion and let you know how it goes.

  19. Posted November 3, 2009 at 6:39 pm | Permalink

    Thanks for the help. I added a logo to the header and used the style.css to edit the location.
    Thanks.

  20. Chris
    Posted November 12, 2009 at 4:10 pm | Permalink

    Are you aware that your solution doesn’t work with Thematic 0.9.5.1? Any idea as to how I can make it work?

  21. Posted November 12, 2009 at 4:49 pm | Permalink

    I am using a custom theme and had no problems with the logo. Will try it out using Thematic 0.9.5.1 and let you know what I find.

  22. Chris
    Posted November 12, 2009 at 5:44 pm | Permalink

    Sorry, I was talking about the general header image solution using the child theme described on this page. It’s not working with the latest Thematic version.

  23. Posted November 12, 2009 at 6:01 pm | Permalink

    I will try to see if I can duplicate the problem you are having. What is the site you are working on? I will try to help out when I get some free time.

  24. Phil Benoit
    Posted November 21, 2009 at 6:38 am | Permalink

    Hi Cristi,

    I am keen to use a child theme options page for other things, any ideas where I could get some info. Eg I have a custom homepage with a youtube vid. I want to make it easy to change without rewriting the .php code. A simple text box where I can put the embed code would be great, any info would greatly help.

    Phil

    • Posted November 21, 2009 at 12:19 pm | Permalink

      Hi,

      Have a look here:

      http://wordpresstheming.com/2009/10/thematic-theme-options-panel/

      It explains how to build a more comprehensive admin panel. You can use the code from the Google Analytics, just change the title and the placing of where it’s displayed inside the theme!

      • phi benoit
        Posted November 22, 2009 at 6:25 am | Permalink

        thanks Cristi

        • Posted November 23, 2009 at 7:01 pm | Permalink

          @phi you do not need to modify the php to embed a youtube video. WP has plugins for it too.

  25. Posted November 29, 2009 at 4:30 am | Permalink

    Thanks! Works like a dream.

    Is there an easy way to just replace the blog name with the image and leave the slogan under it?

    I’m thinking that I might like to change the slogan every now and then. It would be so much easier to keep it as plain text and not add it to the header image.

    • Posted November 29, 2009 at 12:04 pm | Permalink

      Sure. Just comment out the line:

      add_action(‘init’,'remove_thematic_blogdescription’);

      You will now have the blog description under the logo.

  26. Posted November 30, 2009 at 7:01 pm | Permalink

    Editing the CSS should work too if you just want to move the logo and/or description around.

  27. Posted December 14, 2009 at 8:28 am | Permalink

    As you’ll see at my website, there is nothing but an error message. I really messed up. Can you help me figure out how to fix my problem?

    Parse error: syntax error, unexpected T_DNUMBER in D:\Hosting\3056829\html\wp-content\themes\thematicpowerblog\functions.php on line 198

    I popped the code into the Theme Function file in the Theme editor of my wordpress dashboard. It wouldn’t update and gave this error. So, I took the code back out and tried updating and everything is gone with only this error in it’s place.

    I appreciate the help!

  28. Posted December 14, 2009 at 8:50 am | Permalink

    Alright, for some reason, the added code was still in the .php file on GoDaddy. I removed it there and have my site back.

    I’ve tried replacing the original code with this code in the wordpress dashboard, but it reverts back if I try to update. I plugged it in directly at GoDaddy where I’m hosted and it came back with the same error only on line 3. I removed the code.

    I’m using Thematic PowerBlog. Any ideas why this isn’t working?

  29. Posted December 14, 2009 at 9:19 am | Permalink

    Got it now. Had to take out the top <?php. Geesh.

  30. Posted December 14, 2009 at 10:52 pm | Permalink

    @Diana could be a GoDaddy issue. I had a similar one too a while back.

  31. Posted December 15, 2009 at 3:07 am | Permalink

    Thanks for getting back to me. I fiddled within the style sheet and got an image in and still have the title and description under it. It works for now.

    Off to the next problem. After all of this, now my browser and flash image uploaders both say: The uploaded file could not be moved to D:\Hosting\3056829\html/wp-content/uploads/2009/12.

    Yuk, if it’s not one thing it’s another. Maybe you have an article on that? I’ll look.

    • Posted December 15, 2009 at 11:09 am | Permalink

      I don’t really have any idea why that error is there. Again I think it’s something to do with your hosting.

      You can post this error on the new forums here on cozmoslabs.

      This way if we found the source of the error more people will see the solution!

  32. Posted December 15, 2009 at 10:51 pm | Permalink

    @Diana have you tried to move the files manually? That might resolve the issue or help in getting to the bottom of it.

    • Posted December 16, 2009 at 1:17 am | Permalink

      I believe I started another topic somewhere on here. I am able to upload images to my server, I think I can manually enter the html to put them in my pages and posts, not sure yet, but I found by searching around that there seems to be a problem. 2.8.5 Unrestricted File Upload Arbitrary PHP Code Execution has made my files accessible to whatever may have written into them.

      Thanks for your reply.

  33. Posted December 16, 2009 at 10:38 pm | Permalink

    @Diana have you tried switching to WP 2.8.6? It has some cool new features.

  34. Posted December 17, 2009 at 1:08 am | Permalink

    yes, I’m all better now. Still needed some more help, but it’s all good. I’ll have time to check out the new features now that I’m over the image upload problem.

    Thanks

  35. Posted December 18, 2009 at 8:35 pm | Permalink

    @Diana I am glad you managed to solve the problem. Feel free to ask anything in here. The WP community is a great one to be part of.

  36. Posted December 18, 2009 at 9:16 pm | Permalink

    Hi – Excellent article and header programming… thanks.

    Hey, you and Christi could probably win the Thematic Filters and Hooks contest here:
    http://themeshaper.com/forums/topic/contest-best-thematic-filters-038-hooks

    Cook up a good one, and good luck!
    - Scott

  37. Posted December 18, 2009 at 9:38 pm | Permalink

    @Scott I am sure they will win it hands down too.

    • Posted December 18, 2009 at 11:57 pm | Permalink

      Thanks Ed, I can see that there is much to learn and this feels like a good place to be.

  38. Posted December 21, 2009 at 10:00 pm | Permalink

    This is a great site to learn @Diana. You have come to the right place for sure.

  39. Amine
    Posted December 28, 2009 at 9:50 pm | Permalink

    I cant figure this out.

    I downloaded the thematic theme. I followed the instructions on this video to create a child theme: http://www.youtube.com/watch?v=ofK1O20PAJM

    I copied the code above in the functions file in the child theme.

    the child theme is not coming up on the left menu under appearance.

    Thanks in advance for your help.

  40. Posted December 28, 2009 at 11:17 pm | Permalink

    Sorry cannot be of much help as I have not tried this myself

  41. Amine
    Posted December 29, 2009 at 6:21 am | Permalink

    I created the child theme folder. I opened the functions.php file and I have the following code:

    ‘Home’,
    // ‘sort_column’ => ‘menu_order’,
    // ‘menu_class’ => ‘menu’,
    // ‘echo’ => true
    // );
    // return $args;
    //}
    //add_filter(‘wp_page_menu_args’,'childtheme_menu_args’);

    ?>

    where do I add the code listed above in this blog in functions.php

    i appreciate all the help/.

  42. Amine
    Posted December 29, 2009 at 6:27 am | Permalink

    This is the code I have in functions.php

    ‘Home’,
    // ‘sort_column’ => ‘menu_order’,
    // ‘menu_class’ => ‘menu’,
    // ‘echo’ => true
    // );
    // return $args;
    //}
    //add_filter(‘wp_page_menu_args’,'childtheme_menu_args’);
    ?>

    where does the code in above post in the blog goes?

  43. Amine
    Posted December 29, 2009 at 4:25 pm | Permalink

    I resolved the issue above…:)

    I was able to succesfully add the child theme folder.

    Now, when I try to upload the Logo, I get the following error:

    Warning: fopen(/tmp/phpTsOaIP) [function.fopen]: failed to open stream: Success in /home/content/a/b/e/aberrad/html/wp-content/themes/Thematic Child Theme/functions.php on line 24

    Warning: fclose(): supplied argument is not a valid stream resource in /home/content/a/b/e/aberrad/html/wp-content/themes/Thematic Child Theme/functions.php on line 26

  44. Posted December 29, 2009 at 10:07 pm | Permalink

    @Amine what version of WP are you on? Seems like an internal conflict of some sort in there.

    • Amine
      Posted December 29, 2009 at 10:33 pm | Permalink

      I’m using the latest version of wordpress.

      Thanks Ed for looking into this.

  45. Amine
    Posted December 30, 2009 at 5:30 pm | Permalink

    I deleted the thematic theme and the child theme. I reinstalled everything from scratch and I’m still getting the same errors. I think the problem is either in the code above or maybe something that has to do with my godaddy hosting account.

  46. Posted December 30, 2009 at 8:30 pm | Permalink

    @Amine it could be in the code then or certain upgrades done to WP could be causing it too. I use Go Daddy too so do not see a reason there.

  47. Posted December 30, 2009 at 8:31 pm | Permalink

    @Amine also try copying and pasting from a .txt page. This way you might pick up any extra fomatting code.

  48. Amine
    Posted December 30, 2009 at 11:39 pm | Permalink

    I just tried that and I still have the same error. The day this works, i’m gonna throw a party.

    • Posted December 31, 2009 at 7:44 pm | Permalink

      Has to do something with the code most probably.

    • Amine
      Posted January 4, 2010 at 5:48 pm | Permalink

      TO THE ADMINS WHO WROTE THIS PAGE:

      I think its best if you delete this page since your code is not working. I have been trying this for days with no luck….:)

      • Posted January 5, 2010 at 2:56 pm | Permalink

        Sorry Amine to take so long to answer you. I’ve been away on a short vacation.

        What you’re experiencing is that your server isn’t allowing for your image to be uploaded.

        Try and put @ in front of fopen and fclose like so:
        @fopen
        @fclose

        It’s a long shot but it might work.

        • Amine Berrada
          Posted January 5, 2010 at 5:18 pm | Permalink

          @ed @critsian@scott

          Thanks very much for your input.

          I added @fopen and @fclose and the good news is the error does not pop up anymore. The bad news is the image is still not there…:)

          As you can see from the website using internet explorer, the image is trying to show up but there is an X.

          http://www.isearchbankhomes.com

          I’m using godaddy hosting account and I set up the uploads folder to writing permission.

  49. Posted January 4, 2010 at 6:01 pm | Permalink

    Hello Armine -

    There is no need to delete this post. I have used the supplied code and tested it at a couple of installations, and it works fine. It has worked fine on both WP 2.8.6, and also now on version 2.9. If it works well on other sites, Armine, that means the problem may lie with your hosting set-up, how your L-A-M-P stack is configured, or even a tiny bit of code — just one character — accidentally deleted. Best of luck with it
    - Scott

  50. Posted January 4, 2010 at 7:14 pm | Permalink

    @Amine it could be your hosting setup or a kink somewhere in the code. Try it on a different computer and see if it works out.

  51. Posted January 5, 2010 at 8:29 pm | Permalink

    @Amine you are welcome. The images not showing up could be a database issue if you pull your images from within there.
    Good luck.

    • Amine Berrada
      Posted January 5, 2010 at 9:49 pm | Permalink

      I downloaded another theme (pixel) and I was able to upload the header without any problems….:) Not sure why the thematic child theme wont let me…

  52. Amine Berrada
    Posted January 6, 2010 at 6:06 pm | Permalink

    dammmm it. my buddy from canada just figured it out for me and its something very stupid…lol

    this is his message:

    ou’re working with a linux web server for your site, so the file names are CASE sensitive, i.e. LOGO2.jpg and logo2.jpg are not same.

    Either you can rename the file to match what it is being called or change the way it is being called.

    . if you go to any page on your site and right click, IE or firefox will give you this menu item ‘view source’. Once you select that it’ll bring up a page in html, here you can search for that file ‘logo2.jpg’ and you can get more details.

    thanks for everyone for trying. its truly appreciated and thanks for the thematic and child theme. its truly appreciated. as someone famous said. there is no such thing as genius, its all about persistence……:)

  53. Posted January 6, 2010 at 7:14 pm | Permalink

    @Amine on a Linux server you have to be careful naming files. Always best to use all lower case alphabets or numbers, nothing else.

  54. Posted January 6, 2010 at 7:15 pm | Permalink

    Good Luck with your project @Amine. Is your site working now?

    • Amine Berrada
      Posted January 6, 2010 at 7:16 pm | Permalink

      yes, its awesome

      http://www.isearchBankhomes.com

      i still have lots of work to do to finish it up…:)

      • Posted January 7, 2010 at 10:06 pm | Permalink

        Very well done site @Amine. What images were you talking about. All image links are working fine.

        • Amine Berrada
          Posted January 7, 2010 at 11:21 pm | Permalink

          @ed thanks for the compliment. Feel free to give any feedback on my website. It was the Banner that wouldn’t show up because of the case senstivie issue….got it working finally…:)

  55. Posted January 8, 2010 at 10:35 pm | Permalink

    I am glad it all worked out for you in the end. Persistence pays off big time.

  56. Michael
    Posted January 9, 2010 at 12:45 am | Permalink

    Any guidance on what size the banner image should be?

    • Posted January 11, 2010 at 7:38 pm | Permalink

      Just look for the size of the banner in the HTML and make sure the image size is the same or lesser than it.

  57. Kyndra Goodman
    Posted January 11, 2010 at 10:54 pm | Permalink

    Does it matter if you stick this PHP code at the bottom of your functions.php in Thematic? Or does it need to be somewhere specific?

    Thanks so much,
    k.n.

    • Posted January 11, 2010 at 11:05 pm | Permalink

      This is thought to be uses inside the functions.php file of a child theme. This way you won’t make any modifications to Thematic and future updates to the framework will be really simple to do.

    • Posted January 12, 2010 at 7:32 pm | Permalink

      @Kyndra that should be fine.

  58. Posted January 15, 2010 at 9:33 pm | Permalink

    Hi, I added the code to my child theme and uploaded a test image and it went up without a problem. I then switched it out with the same image (but with text added), and it now shows this:

    Warning: fopen(/tmp/php2jY71f) [function.fopen]: failed to open stream: Success in /home/reddwarf/public_html/wp-content/themes/thematic/functions.php on line 113

    Warning: fclose(): supplied argument is not a valid stream resource in /home/reddwarf/public_html/wp-content/themes/thematic/functions.php on line 115

    and the header is no longer appearing. Please forgive me if the answer is obvious, I’m clueless with this stuff.

    • Posted January 15, 2010 at 9:43 pm | Permalink

      just as an addition – the original test banner still works. What am I doing wrong with the new image? It’s the same file size, width and height, file type, etc.

  59. Posted January 15, 2010 at 10:11 pm | Permalink

    The text on the image looks to be the issue here. Does it work well without the text? Have you tried to overlay the text over the image or is the text part of the image itself?

    • Posted January 18, 2010 at 1:12 am | Permalink

      I overlayed the text on the image via photoshop. The original image still works, but no other image seems to work, with or without text.

      I’m going to keep fiddling to see if I can discover what makes this image different from the others… any suggestions? You may want to try sending me an image that works for you to see if it works for me as well.

      Is it possible I added the code incorrectly and that’s the source of these inconsistencies?

  60. Posted January 18, 2010 at 8:26 pm | Permalink

    Have you tried to superimpose your text on your image in Photoshop and save it to your desktop? Then go ahead and upload it to your theme’s folder? I have done that at times to make text over images work.

  61. Posted February 1, 2010 at 4:48 pm | Permalink

    I added the code to my functions.php in my child theme and now I am getting this error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/hypr/public_html/blog/wp-content/themes/johng/functions.php:104) in /home/hypr/public_html/blog/wp-includes/pluggable.php on line 868

    Not sure what I need to do to fix this. Any thoughts?

    • Posted February 1, 2010 at 10:33 pm | Permalink

      This probably means you have spaces after the last php closing tag in functions.php.

      Check for that and let me know if it fixed it!

      • Posted February 2, 2010 at 3:01 am | Permalink

        Yeah, I think it was just a syntax error. I re-pasted the code along with some of my other functions and everything started working just fine. Thanks very much for the input!

        • Posted February 2, 2010 at 7:41 pm | Permalink

          Am glad it worked out for you. Nice place to ask questions here.

  62. Posted February 1, 2010 at 10:00 pm | Permalink

    Could be a syntax error. I would check for mistakes there first.

  63. Posted February 12, 2010 at 9:29 pm | Permalink

    @Brenda what server are you on?

  64. Posted March 15, 2010 at 5:30 am | Permalink

    I’m using Buddymatic with the basic Buddymatic child theme. I thought I’d give this a shot.

    I was really encouraged when, after pasting the above code into my theme’s function.php, I got the options page on my backend and it appeared to work flawlessly. That is, it let me upload my custom image and it appeared on the option page. Except that it didn’t actually change my site.

    I’m thinking maybe that there’s something simple that needs to be changed to make this work. Any ideas?

    • Posted March 15, 2010 at 5:53 am | Permalink

      Nevermind! Got it going!!! I was pasting it into my functions.php incorrectly!

      Beautiful! Thanks!

  65. Posted March 15, 2010 at 9:42 pm | Permalink

    Be careful about how and where you enter code in the functions.php file.

  66. BM
    Posted April 3, 2010 at 1:15 am | Permalink

    Would it be possible to have rotating header images? Like for instance having a folder of header images, one of which is randomly chosen every time the page is loaded?

    Thanks

  67. Posted April 3, 2010 at 7:57 pm | Permalink

    You might need to do some custom coding to the CSS in order to achieve that @BM.

  68. Posted June 3, 2010 at 7:36 am | Permalink

    prior to the commencement, let me say THX for this! I’ve implemented the code in my Thematic child’s functions.php. It works fiine and lets me change the header image and fade out blog’s title and description.

    Just one problem:

    Warning: fopen(/tmp/php2jY71f) [function.fopen]: failed to open stream: Success in /home/reddwarf/public_html/wp-content/themes/thematic/functions.php on line 113

    Warning: fclose(): supplied argument is not a valid stream resource in /home/reddwarf/public_html/wp-content/themes/thematic/functions.php on line 115

    I’ve checked the code several times: no unwary spaces, nothing that a. explains the error message or b. explains why everything’s working fine although I receive that message. Any idea?

    • Posted June 3, 2010 at 8:28 am | Permalink

      Those are warnings and not error messages. Your server should have not displayed those… I think…

  69. Posted June 3, 2010 at 4:32 pm | Permalink

    Looks like a parsing error encountered by your server. Did you check the line it says the error was on?

    • Posted June 3, 2010 at 5:39 pm | Permalink

      Here’s the exact message:

      Warning: fopen(/tmp/phpbnhsuA) [function.fopen]: failed to open stream: Success in /home/web160/klem08/ftproot/www.kunstgriff-pix.org/wordpress/wp-content/themes/simply_sankt_pauli/functions.php on line 50

      Warning: fclose(): supplied argument is not a valid stream resource in /home/web160/klem08/ftproot/www.kunstgriff-pix.org/wordpress/wp-content/themes/simply_sankt_pauli/functions.php on line 52

      Your code starts @ line 28. There’s some code for a home link in the menu and a custom footer in those first lines.

      • Posted June 3, 2010 at 6:03 pm | Permalink

        After having removed the first lines (just this code is left) it says line 24 and 26.

  70. Posted June 3, 2010 at 8:41 pm | Permalink

    Looks like an opening and closing script error there. Need to see the entire code to figure it out.

  71. Ana
    Posted June 5, 2010 at 3:45 am | Permalink

    Awesome thank you!

  72. Posted June 13, 2010 at 6:53 pm | Permalink

    Help. I am very new to wordpress customization. I have successfully installed a child theme of thematic but am running into difficulty when adding this php code to functions.php. I save it and it says “file updated successfully” but then I don’t have a child theme options tab underneath appearances. Does the latest version of thematic support this, or am I missing a crucial step. It is for this site http://www.tybeenorthbeachrentals.com

    any and all feedback is greatly appreciated!
    Thanks!

    • Posted June 13, 2010 at 7:42 pm | Permalink

      I edited functions.php outside of wordpress and uploaded it via ftp. This solved the problem! Thanks for the great code!!

  73. Posted June 14, 2010 at 7:32 pm | Permalink

    You should be able to edit it on server backend also. No need for FTP to do something like that.

  74. kathy
    Posted June 22, 2010 at 5:18 am | Permalink

    what is your opinion on how the loss of the header tags might affect SEO?

    i’ve been trying to tweak this so that you can have the image and the headers. it is easy to tweak the code such that the image is the background image for the h1 tag and text-indent away the link, but i find this only works when i know the specific dimensions, in which case why do i need an options panel.

    except that i want the options panel if i am developing a theme for public consumption… and i like to use timthumb so that i can keep a lid on the max size of the logo image.

    def havent figured this one out yet, but it is a great addition to an options panel!

    • Posted June 22, 2010 at 7:08 pm | Permalink

      You can have text links over the image. Use style.css to add it on.

  75. Posted June 25, 2010 at 3:35 pm | Permalink

    Have to some more testing with WP 3.0 to make sure it is compatible.

  76. Posted July 1, 2010 at 7:30 pm | Permalink

    So I added the code and the admin section came up. When I tried to upload an image I got this message:

    “Warning: fopen(/tmp/php4zGvst) [function.fopen]: failed to open stream: Success in /home/content/88/6358288/html/wp-content/themes/thematic/functions.php on line 119

    Warning: fclose(): supplied argument is not a valid stream resource in /home/content/88/6358288/html/wp-content/themes/thematic/functions.php on line 121

    • Posted July 1, 2010 at 7:32 pm | Permalink

      Looks like a scripting error. Check the code.

      • Posted July 1, 2010 at 7:41 pm | Permalink

        Anything specific I should be looking for. Is it something in the function.php file or somewhere else?

        • Posted July 2, 2010 at 5:15 pm | Permalink

          Try checking it at php.net to start off. Who is your host?

    • Posted July 2, 2010 at 10:51 am | Permalink

      Hey Felton.

      That error appears on certain hosts and to be honest I haven’t figured it out so far. Some php configurations work without any issues while others don’t.

      Try and have a look at this:
      http://webcache.googleusercontent.com/search?q=cache:l92Jmg-abbcJ:php.net/manual/en/function.fopen.php+Warning:+fopen%28/tmp/phpbnhsuA%29+function.fopen:+failed+to+open+stream:&cd=3&hl=en&ct=clnk&client=firefox-a

      It’s the fopen function over at php.net. Maybe it can help you.

      • Posted July 20, 2010 at 5:15 am | Permalink

        After attempting to upload my image I’m getting a similar message. Errors are on different lines though:

        Warning: fopen(/tmp/phprpILcL) [function.fopen]: failed to open stream: Success in /home/alidabar/public_html/wp-content/themes/thematics-child/functions.php on line 24

        Warning: fclose(): supplied argument is not a valid stream resource in /home/alidabar/public_html/wp-content/themes/thematics-child/functions.php on line 26

        Concerning the first line, line 24, the copy & paste code uses the ‘rb’ mode as follows:

        $fd = fopen($temp_file,’rb’);

        line 26 looks like this:

        fclose($fd);

        Chris, I read the PHP manual you linked to and it looks like it might be a server issue but my other concern is that it might be a operating system issue? I am working on a Mac. Could it be this simple/dumb?

        I’ll try editing it in plain text (which is what I did originally-so I’ve tried copy and pasting in both plain text and my code editor) on my PC and report back. I’m wondering if the type is getting mixed up in the cutting and pasting, depending on what editor I’m using vs. what the original code was written in. Oh the little details!

        Keep me updated if anyone figures it out or has any other suggestions. Thanks!

        • Posted July 20, 2010 at 5:21 am | Permalink

          PS. I’m also going to mess around with the modes and try ‘t’ vs. ‘b’ etc. as apposed to ‘rb’. Somebody let me know if I’m way off in left field on this one, please!

        • Posted July 20, 2010 at 9:14 am | Permalink

          To be honest I never tested this in a Mac. File permissions could be different. I never tested this on a Windows server. Only on Linux.

          I’ll need to have a look at this code since it appears to be causing people issues sometime in the near future. Maybe I can come with another solution.

        • Posted October 1, 2010 at 10:09 pm | Permalink

          In my case I believe these errors were caused by “smart quotes” being used in the code. I replaced the smart quotes with straight quotes and the errors were resolved.

        • Gary
          Posted March 30, 2011 at 12:09 am | Permalink

          Replacing the smart quotes worked for me too. The original code listed above includes them. For those of you who don’t know, the smart quote is a ’ character, and the straight quote is a ‘ character. Very easy to miss!

          original code:
          $fd = fopen($tmpfile,’rb’);

          replacement code:
          $fd = fopen($tmpfile,’rb’);

  77. nick
    Posted July 8, 2010 at 4:13 pm | Permalink

    Hi Cristian, I’ve added the child theme, and the header image, however now the title shows up in the left under the menu. How can I hide it ?
    (if I dont use a title than it doesnt show up but there will be no title in the window browser)

    • Posted July 8, 2010 at 6:22 pm | Permalink

      You might have to edit your css file to move the title around.

    • Posted July 9, 2010 at 10:11 am | Permalink

      Hi!
      Can you provide a link to your site?

  78. Sam
    Posted September 7, 2010 at 7:01 pm | Permalink

    Hi there,
    I’m using Auto Focus Pro and I’m a bit confused when accessing the functions.php file –

    I have tried adding the code and saving, but nothing appears in my Appearance menu

    I feel I’m missing something glaringly obvious (and I’m not the biggest CSS guru.) Any help would rock, thank you. :)

    • Posted September 8, 2010 at 8:49 am | Permalink

      Could be an issue with incorrect closing < ?php tags. Since you don’t get the white screen of “death” when you do this something else could be the issue, although I don’t know what.

      Do you have a link to your site so I can have a look?

      • Sam
        Posted September 17, 2010 at 8:35 pm | Permalink

        Yeah

        http://sisterbrothermgmtblog.com/

        Any help would be great. Thanks.

        All I’m looking to do is have our logo at the top of the page (a png file) potentially with a link to our website.

        Also, I notice that our slider is missing ….how to retrieve this would be great! :)

    • Posted September 20, 2010 at 9:53 am | Permalink

      Hi Sam,

      To be honest I don’t know what’s behind the Autofocus Child Theme. Also since you’re using the Pro Child Theme, if you payed for it there should be some sort of support for it from the author.

      I had a look at the Autofocus website and it said that in version 1.3: Added WordPress 3.0 Header script for custom logo. So perhaps an upgrade would be in order :)

      As for the slideshow, since I haven’t worked with this theme I don’t know what could cause it to not display it. If you made modifications to the theme and functions.php file chances are you made a typo or something like that and you get these bugs.

      My suggestion would be to backup the theme you have now and put the original one in place. You should have access to both the slideshow and the logo…

      Let me know if that worked out for you.

      • Sam
        Posted September 20, 2010 at 4:25 pm | Permalink

        I did upgrade to the latest version.

        I am a rookie when it comes to CSS so looking through the functions.php file is a hot mess right now lol

        I see “Add New Thematic Blog Title” but how do you actually implement it?

        Thanks so much for your time btw. :)

        Sam

    • Posted September 22, 2010 at 9:14 am | Permalink

      Sam please try and contact the theme author for these questions. From what I can tell, you can do what you want with the current theme, just that you don’t know how. So a clarification on his part would probably help you much more then I can. Just ask him for some screenshots or a walkthrough on how to add a logo :)

      • Posted September 24, 2010 at 4:30 pm | Permalink

        According to the author’s current website, he no longer offers support and recommends other help forums. SIGH. I guess too many people are having issues! :)

        // - Add new Thematic Blog Title
        function autofocus_blogtitle() { ?>
        <a href="/” title=”" rel=”home”>
        <?php }
        add_action ('thematic_header', 'autofocus_blogtitle',3);

        Does this piece of code from my thematic_functions php file have something to do with what I'm looking for?

        Thanks for your help Cristian.

        • Posted September 27, 2010 at 8:07 am | Permalink

          Yup… that could be it. But you’ll have to fill in the blanks:


          function autofocus_blogtitle() {
          echo '';
          }

  79. Posted October 15, 2010 at 8:10 pm | Permalink

    I like the admin panel but after trying this and several other methods i came up with one of my own which seems to be best suited for this purpose.

    This method is by far the best method. It keeps all the SEO optimized Thematic code and it simply adds an empty span to the header and styles it.

    The code is available on my site if you want to try it. If you like it please link to me and comment..

    Thematic Header Image

  80. Leah
    Posted November 19, 2010 at 9:32 pm | Permalink

    Worked like a charm! I was having difficulties figuring out how to hide the #branding div, yet still figure out how to make my logo link to the homepage, this is great!

    • Posted November 19, 2010 at 11:51 pm | Permalink

      You can try a combination of the script on this page and the one in the comment above yours. That may be the solution your looking for.

  81. ace
    Posted January 5, 2011 at 3:10 pm | Permalink

    great work, thanks!

    regarding the error:

    Warning: fopen(/tmp/phprpILcL) [function.fopen]: failed to open stream: Success in /home/alidabar/public_html/wp-content/themes/thematics-child/functions.php on line XX

    Warning: fclose(): supplied argument is not a valid stream resource in /home/alidabar/public_html/wp-content/themes/thematics-child/functions.php on line XX

    Please replace $temp_file with $tmpfile

    That worked for me.

  82. Posted February 7, 2011 at 1:29 am | Permalink

    Worked for me.

    I wanted to have a background header image with a logo floated infront. The background image was easy enough using some css, but I couldn’t work out how to get a logo image to display . This worked straight out of the box. Bit of positioning and it was perfect. Thanks

  83. Jonathan Trenor
    Posted March 16, 2011 at 4:38 pm | Permalink

    Thanks for a great website. Super dooper good support.

  84. Posted May 12, 2011 at 12:59 pm | Permalink

    Adding header image is very interesting. I think I only change the colors of my header in the wordpress. It is because I don’t like to ruin my CSS codes so I just changed it on my free wordpress blog and not in my other blog. Thank you for sharing this.

  85. Posted May 24, 2011 at 11:33 am | Permalink

    I tried using this but every time I upload an image it just sows up as a red x…

    • Posted May 24, 2011 at 2:22 pm | Permalink

      Make sure your image is all in small letters. so YourLogo.jpg, rename that to yourlogo.jpg and then upload.

      • Posted May 24, 2011 at 5:24 pm | Permalink

        Awesome, that fixed it. Thanks for the quick reply!!

  86. Posted May 30, 2011 at 9:38 pm | Permalink

    I modified this a bit to add in an alt (& title) value which is important for SEO & 508 compliance and if you want your markup to validate. The value is pulled from the site title in general settings.

    I replace this bit (line 91)
    echo ‘‘;

    with this:
    echo ‘‘;

  87. Posted May 30, 2011 at 9:42 pm | Permalink

    This is exactly what I needed, thanks for sharing :-)

    I modified your code a bit to include an alt (& title) value which is important for SEO & 508 compliance — and if you want your markup to validate. The value is pulled from the Site Title in General Settings.

    I replace this bit toward teh end (line 91)
    echo ‘‘;

    with this:
    echo ‘‘;

    • Posted May 30, 2011 at 9:50 pm | Permalink

      Ugg I think comment submission freaked out with the php code… it gave me errors with the first one I tried to submit and i refreshed several times but it didn’t look like anything went through, my 2nd one went through but not it looks like the first one did submit but i didn’t put the code blocks so none of them are showing my changes…

      Here it is again, code modified to include alt and title tags:

      replace

      echo '';

      with

      echo '';

    • Posted May 30, 2011 at 9:57 pm | Permalink

      code is still not showing… so I’ll just explain the changes

      You need to modify line 91 (the img tag)

      copy the src string (before the img tag close), rename src to alt and child_theme_image to blogname, copy again and rename alt to title.

      Now you’re logo will have a title and alt attribute. This value is pulled from the Site Title you give on the General Settings page.

  88. Melissa
    Posted August 16, 2011 at 2:18 am | Permalink

    I added the code as suggested but it didn’t work – (fopen + fclose) warnings. Tried again but made mistake of including the and . I can no longer gain access to my WP site – not the administration. I got a screen that said “syntax error” about the functions.php. I should have copied the error message. Nothing worked so I deleted the functions.php out of the main folder and replaced with ‘Thematic’ .php . I now have a fatal error: “Fatal error: Cannot redeclare thematic_remove_generators() (previously declared in /home/e7411092/public_html/WP/wp-content/themes/minimalist/functions.php:134) in /home/e7411092/public_html/WP/wp-content/themes/thematic/functions.php on line 134″

    Is there a way to go back and correct the mess I’ve made? I’m working in a childtheme called ‘minimalist’. If I have to start again, I’m fine with that as I wasn’t far into my project BUT I can’t even get back to the admin page to change my theme. Please help!

    • Posted August 16, 2011 at 11:55 am | Permalink

      Just delete the functions.php in your childtheme or replace it with the one in minimalist theme if you still have it. Then you should be able to login in the administrator.

  89. Brian M
    Posted September 20, 2011 at 9:00 am | Permalink

    I used this code, slightly customized, to include a logo upload feature in a WordPress theme I created. I attempted to upload the theme to the WordPress Free Themes Directory but got an error related to some of the code from this feature….

    “WARNING: file_get_contents was found in the file functions.php possible file operations.”

    Is there any way to include this functionality in my theme without using “file_get_contents”, or “fopen”, and other code that the WordPress Theme Checker doesn’t like?

  90. Posted September 21, 2011 at 11:12 pm | Permalink

    Hi there, I installed this and it’s not working! Email me please for help!

  91. Posted April 27, 2012 at 2:40 pm | Permalink

    I’ve used this code on another website and it worked perfectly, I have been trying to do it on my site and I get error messages. Can you please email me for some help?
    Daniela

4 Trackbacks

  1. [...] Add a Header Image to Thematic the Easy Way [...]

  2. [...] Add a header image to Thematic – the easy way (tags: wordpress tutorial) [...]

  3. By Back to the roots of clear WordPress design on June 2, 2010 at 4:59 pm

    [...] zupass kam, es um einen anpassbaren Kopf (neudeutsch: custom header) ergänzt, zu dem ich mich hier habe inspirieren [...]

  4. [...] Add a Header Image to Thematic the Easy Way [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

* Copy this password

* Type or paste password here:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>