Wp Unique Article Header Image Plugin for Wordpress

September 22nd, 2008

Posted by brajesh

hi all.here I am back with another brand new plugin to enhance your blog.Ok,If you have ever thought of the following,then this plugin is for you.

  • You wanted to show unique header image on each single article page of your wordpress(or may be on some of the single article pages)
  • You wanted to have a unique background image for each of your single article page(or may be just on some of them)

If your answer is yes,Then this plugin is for you.It allows you to upload an image using the wordpress new post/edit post/page window.It adds a file uploading button just below the title of the post as shown below

New Post window
2

Now select an Image and when you click publish/save the default image is changed with the current image.

Browse Header Image to upload
2008-09-17_055340

Once you click save/publish,Go to manage->posts->your post and click to edit.you will see that the default image is changed with the new image uploaded.

Post edit window
edit-screen-gt-unique-header

How to use

For your use there is a method gt_get_image_url(), it returns unique image associated with each post.you may use it in any way you want.here is an example,how I modified the default theme on the demo server to show unique header images on each post.

Now,let us edit our themes header.php to make use of unique header on each of the page.we add following snippet of code to our header .php

Code snippet to be modified

Code snippet to be modified

[Please note this code shown here, is for the default theme Kuberick,which comes with wordpress,depending upon your theme and header you may need to use custom css here]

See the live demo here [Click on the articles on the demo site to see the use of unique header thing)

NOTE:It seems ,someone has deleted all the posts from the demo site,as i mistakenly provided the test user rights to edit/delete posts.well,I will be correcting my mistake tomorrow.For the time being,I encourage you to login and try uploading some image of your choice on the demo site and looking at it in action.

http://plugins.wpdemos.com/gt-unique-header-image/

Do you want to try it yourself,well use following credentials

http://plugins.wpdemos.com/gt-unique-header-image/wp-admin/

User: test

Password: test

Try,posting some new posts with any image of your choice and then click to view the page.
ok,so you need a download link now.Here goes the download link
http://downloads.wordpress.org/plugin/wp-unique-article-header-image.zip

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • description
  • Furl
  • IndiaGram
  • LinkedIn
  • Live
  • Ma.gnolia
  • Netvouz
  • Slashdot
  • SphereIt
  • StumbleUpon
  • Technorati
  • TwitThis

Tags: ,


57 Responses to “Wp Unique Article Header Image Plugin for Wordpress”

  1. Patrick’s Blog » Themenbezogenes Headerbild in Wordpress Says:

    [...] Anforderungen erforderte nur kurze Recherche meinerseits - ein entsprechendes Plugin existiert: Wp Unique Article Header Image. Mit diesem Plugin kann man pro Post bzw. Seite ein Headerbild definieren. Nun muss man das Ganze [...]


  2. Marc Jansen Says:

    Hi brajesh,i have been trying since a few day to get your script working. No chance what so ever.Your idea of a unique image for single article is brilliant (but only if I could get it to work)I am using wordpress 2.6.3 with default theme.I always get the following error Warning: mkdir() [function.mkdir]: No such file or directory in /blog/wp-content/plugins/wp-unique-article-header-image/GTUniqueHeader.class.php on line 34

    Fatal error: Cannot access empty property in /blog/wp-content/plugins/wp-unique-article-header-image/GTUniqueHeader.class.php on line 39When I write an article wordpress does not shot a view of the default image or does upload a image.I have edited the header.php and changed the wp-config.phpMaybe i am using the wrong urls in admin -> GT Unique Header ImageThanks in advanceKind regards from Germany and keep up the good workMarc Jansen


  3. Marc Jansen Says:

    Sorry my mistake I did not give the “upload” directory the necessary rights.Still working on it.I will post a comment, when i have got it workingthanks againmarc jansen


  4. brajesh Says:

    hi Marc,Thanks for stopping by.I am very glad to see your message here.Well,It is required that your uploads directory must be writable,otherwise Image can not be stored on the server.I just tried by posting a new message on the demo site and It worked.If you have any issue  with implementing the plugin,direct me to the blog you are trying to implement it and I will assist you as soon as possible.I am sorry,I should have posted more details.Will be posting the more details about setting up the directory permission later.bye the way,I checked your post at demo site,It showed me default image,try uploading Image and publishing the post.It must work.
    Thanks
    Brajesh


  5. Marc Jansen Says:

    Hi Brajesh, you are realy cool, thanks for the fast reply. Solved the problem, just had to rewrite some codes and voila “Its WORKING”. I will post you, what i have changed and some tips (how to avoid some problems) tomorrow. thanks a million. by the way your plugins is the best one for wordpress (giving it a unique style). your are definitely MASTER OF PHP CODE Thanks for your precious time. Marc Jansen


  6. brajesh Says:

    hi Marc
    Thanks for your wonderful comments.I will look forward to your message tomorrow.I hope your helpful tips and ideas will add to the further improvement of the plugin.
    Thanks Again
    Brajesh


  7. Canales Says:

    Hello, very nice plugin and it works great, really.My Q is that i want to use a swf instead of an image, how can i do that.Is there a way around this?…the site i´m working on is http://www.beackereihermann.de Thank you Alfredo canale swww.elmotin.com


  8. brajesh Says:

    hi Alfredo
    Greetings! I checked your site and it seems down at this time[beackereihermann.de].Yes, you can insert swf file instead of images.You don’t need to modify the plugin.
    Just you have to write the embed element like <embed src=<?php echo gt_get_image_url();?>”..more codes… />.Fore more information on embed check http://www.w3schools.com/tags/html5_embed.asp.
    Here what we are doing basically,calling the same function which outputs image url to output swf url.

    Hope it helps.If you have any other issue,please let me know.I will love to assist you.
    Thanks
    Brajesh


  9. Canales Says:

    Hi…thanks…i will try this…other thing is what if i want to only use swf header in first page and the other pages in jpg…will it work if i pu the embed tag even if it is an image?..the right adress is……www.baeckereihermann.de


  10. brajesh Says:

    hi Alfredo

    well,I am not sure ,give it a try or i will try and post her ,but the standard use of embed should not be to imbed images.
    Better, you may try using conditional tags.check details here http://codex.wordpress.org/Conditional_Tags

    using something like
    <?php if(is_home()):?>
    <embed ..code here —-  />
    <?php else: ?>
    <img ..or standard use here —-/>
    <?php endif;?>

    it will solve your problem.
    If you need any other assistance,please drop me a message here.
    Regards
    Brajesh


  11. WordPress Plugins Releases for 10/30 | bloground.ro - Blogging resources, WordPress themes and plugins for your development Says:

    [...] WP Unique Article Header Image [...]


  12. WordPress Plugins Releases for 10/30 | Wordpress Blog NL Says:

    [...] WP Unique Article Header Image [...]


  13. WordPress Plugins Releases for 10/30 | BlogBroker24-7 Says:

    [...] WP Unique Article Header Image [...]


  14. dlv Says:

    great one! thanks for do soemthing like that and sahre it…great work, congrats!!adeux


  15. Panda Says:

    Hi, Brajesh.I’m having the same issue as the first person who commented, with the PHP errors about being unable to use the mkdir function.  I read your response, about changing the permissions to the “uploads” folder, but I’m not sure which folder you mean.  I don’t have any folder called “uploads” anywhere on my server.  Forgive me if I missed something in your directions — Do I need to create this folder somewhere?  If so, where?


  16. Trisha Says:

    I like the idea of this plugin very much for my blog. I installed the plug in but received the following error message while trying to activate:Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/pal0216/public_html/missingandmurderedchildren/wp-content/plugins/wp-unique-article-header-image/GTUniqueHeader.class.php on line 83I am using the current version of WP and The Journalist theme. I tried deactivating all plugins and then activating only yours but still received the same error message. Does the snippet of code still need to be inserted in the header.php file because you do not state that on the WP Plugin page.Thanks again for this great idea for a  plugin


  17. martin Says:

    On all my sites (with different versions of WP - INCLUDING v 2.63) the plugin fails to load with fatal error message. Keep working on it! Good luck


  18. Joachim Says:

    Hi there,very nice plugin. thanks for sharing.so longJoachim


  19. Best of the Wordpress hacks seen lately - Daily SEO blog Says:

    [...] Brajesh has a nice plugin developed that will help you to make unique image headers appear for each post, on Kubrick based WordPress themes. Easy to use plugin, but only for Kubrick lovers. Tutorial here. [...]


  20. Srecko Bradic Says:

    Amazing work!!! Thank you very much for your time and share of your knowledge with us. Just one question- do you plan to make similar script for use flash for instead of header image? This will be great step forward in development of WP as well Flash is not much supported as I know.Best regards and keep on good work!Srecko Bradic, Serbia


  21. Weblog Tools Collection: WordPress Plugins Releases for 10/30 | PR & Tech Says:

    [...] WP Unique Article Header Image [...]


  22. brajesh Says:

    @allHi all,Thanks you for using the plugin and dropping by here.I am sorry I could not reply you earlier.Let me tell you something.The current version 1.0 requires PHP 5 .so,If you don’t have PHP 5 on your server you will get errors.I am planning to release an enhanced version 1.1 this weekend,which will be compatible with PHP 4 and PHP 5 both.continued in next message….


  23. aulia Says:

    i can’t see d’screenshot??


  24. brajesh Says:

    hi Again

    Some of the persons finding Issues with uploading after success full activation of the  plugin  should do the following
    1.Please check the uploads directory exists inside your wp-content/ folder
    2.Give the uploads directory a permission of at least 666(read write by owner group and others) .
    If you have  still any issue,Please post here,I promise to reply asap.
    Thanks
    Brajesh


  25. brajesh Says:

    @dlv
    Thanks for dropping by
    @Panda,Thanks for dropping by.Please check comment number 23,I have given a general explanation on what to do.
    If you have still any issue,please leave a message here,I will get back to you as soon as possible.
    @Trisha,It seems your server is using PHP 4,That’s why this error is occurring,please wait till this weekend,In next release I am adding PHP 4 support,Currently it only supports PHP5.
    @Martin ,It seems you have same issue as Trisha,Please let me know,if you are using PHP5,currently it does not supports PHP4.

    @Joachim,Thanks for dropping by.

    @Srecko,Thanks for your message.well, you can use this for flash header too.Just you need to embed the flash in header as mentioned in my comment number 8 and 10


  26. brajesh Says:

    @aulia
    hi,Thanks for dropping by.
    For the screnshots of plugin in action,please visit the demo site given at the bottom of the post.
    Try posting your own custom header and testing it.
    Regards
    Brajesh


  27. Trisha Says:

    <blockquote><span style=”font-style: italic;”>@</span>Trisha<cite>,It seems your server is using PHP 4,That’s why this error is occurring,please wait till this weekend,In next release I am adding PHP 4 support,Currently it only supports PHP5.</blockquote>I logged into the server and this is what it says about the PHP version they are running:PHP version5.2.6So, what else could be causing the error message if my server is in fact running PHP version 5?


  28. WordPress Plugins Releases for 10/30 · Softonix.com Says:

    [...] WP Unique Article Header Image [...]


  29. Weblog Tools Collection: WordPress Plugins Releases for 10/30 | KaosKoxp Oyun Portali Says:

    [...] WP Unique Article Header Image [...]


  30. Weblog Tools Collection: WordPress Plugins Releases for 10/30 - Gazeteler & Gazete Oku & Dünyadan Tüm Haberler Says:

    [...] WP Unique Article Header Image [...]


  31. Wisedog Says:

    Great plugin, got it working on wordpress 2.6.3 using magicblue theme. I did not encounter any problems.

    I have a few suggestions for a future release that may be worth looking into:

    1. The ability to change the upload location from wp-content/uploads/ to a user specified folder.

    2. The ability to switch back to the default header image if the user decides not to use the one they just uploaded.

    3. The ability to select a header image that is in the uploads folder as well as delete a header image.

    Keep up the good work, I will definitely recommend this plugin to my friends.


  32. brajesh Says:

    @Trisha
    Thanks for the info.
    Well,I am  little bit busy with a plugin for my client.I will get back  to you with a definite solution this weekend.That’s my promise.

    @Wisedog
    Thanks for dropping by and your suggestions.
    I completely agree with you on the improvements of plugin.I will definitely add your suggestions in the next release.

    @all
    Hi all,please let me have your thoughts and suggestions here,I will certainly incorporate them ,if they will help to enhance the functionality of the plugin.All your valuable suggestions are most welcome.

    Thanks
    Brajesh


  33. Miguel Says:

    HiWhen I try install the plugin I get the error:parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in/usr/shared/web/migu39/wp-content/plugins/wp-unique-article-header-image/GTUniqueHeader.class.php on line 83


  34. Miguel Says:

    In time. After get the error I put in wp-config.php the line <?php define(’WP_POST_REVISIONS’, false); ?> but get the same error….


  35. brajesh Says:

    Hi Miguel
    Can you tell me your server configuration.I.e which version of PHP you are using.
    As far as I can see,This is because your server is using PHP 4.At line 83,there is first public function (constructor) of GTUniqueHeader dfined.
    PHP 4 does not recognizes public keyword,that’s why the error is coming.I will be posting an updated version of the plugin within next 2-3 days which will be compatible with php4.
    Please wait a little.

    Thanks
    Brajesh


  36. Panda Says:

    Okay, I finally got it to accept the header image I wanted.  However, I didn’t realize that I’d have to add something to the PHP code for the header.  Since I know absolutely nothing about PHP I don’t think I’m going to be able to figure this out.  I have a friend who, I hope, can help me get it figured out in a few weeks.  In the meantime, I’ll have to go with it as-is.Maybe you can answer one question for me:  Why is it that you recommend disabling the revision history for the posts?  If I don’t do that, will I encounter errors, or does it just not properly save the history for the uploaded images?  I rather like the history feature and I’d prefer not to disable it if I don’t have to.


  37. Miguel Says:

    brajesh,I understand now - realy is php 4. Thanks for your reply and I will wait for the update!!!Regards 


  38. WordPress Plugins Releases for 10/30 | PATRON DIGITAL.COM Says:

    [...] WP Unique Article Header Image [...]


  39. links for 2008-11-01 » a big guy in a big city Says:

    [...] n Wp Unique Article Header Image Plugin for Wordpress | Geeky Talks |All about wordpress and programmi… [...]


  40. Weblog Tools Collection: WordPress Plugins Releases for 10/30 | Aslifm Blogu Says:

    [...] WP Unique Article Header Image [...]


  41. 13 steps » World Wide Winter Says:

    [...] WordPress sites to give you coding tips and tricks seem to be the latest rage, and new plugins are coming so fast and many you’d think everyone’s been stockpiling their code over the summer. [...]


  42. donnie Says:

    Really like how this Plugin works, but i have a site running PHP4 i would like to use it on . Noticed you were going to do a version for this. How did you get on with the PHP 4 one?


  43. Upcoming Plugins | Geeky Talks |All about wordpress and programming Says:

    [...] « Wp Unique Article Header Image Plugin for Wordpress [...]


  44. Ence Says:

    hi there, could you tell me where the this image file store because i want to update also. if i upload wrong image first time so it can’t be edit second time. could you tell me where this value store. means which database table or file… Thank You Ence


  45. Miguel Netto Says:

    Well…I waited 30 days for the update to PHP 4.x…Where is brajesh ? The project to PH4 is abandoned?


  46. Update:I am still alive :D | Geeky Talks |All about wordpress and programming Says:

    [...] are the updates and future plans about the two of my released plugins.Thank you very much miguel for your patience.I have not abandoned the plan for wp-Unique-article-header-image to port to [...]


  47. brajesh Says:

    @Panda
    Hi,I was not visiting my blogs frequently ,so could not reply you earlier.
    If you want I can assist you in using it on your blog.The second thing, you may not turn off the auto save feature,But it is recommended because sometimes issues may arrive.But you won’t loose any  data if you have enabled the auto save.


  48. brajesh Says:

    @Miguel
    Hi,sorry I could not update it earlier but in the next release scheduled around 20-21st dec,I am going to add many more features including the PHP4 compatibility.Thanks for your patience.


  49. Panda Says:

    Arighty then.  As for adding it to the blog somewhere, I assume you have to throw something in to the PHP for it, right?  I’m lookin’ at what you said in the post about how it’s done and it sort of makes sense to me, but I wouldn’t want to blow anything up so I’m not going to touch it for the moment.


  50. Mel Says:

    I really like the concept of this plugin. Originally I tried using it with PHP 4 which didn’t work. I have now upgraded to PHP5 and was able to activate the plugin. When I add an image for the header of a page it doesn’t put the image in the header. Any idea of what I am doing wrong?


  51. brajesh Says:

    hi Mel
    Sorry ,I forgot to mention here,but I mentioned in the readme.txt,since you are using wordpress 2.5+,so you will need to turn off the post revision,for that you may use one of the available plugins or just edit wp-config.php and add following  lines
     
    <?php define(’WP_POST_REVISIONS’, false); ?>
    That’s all you are done
    and It will work perfectly.
    Thanks
    Brajesh


  52. Chrys Says:

    Hello,I installed your plugin and I have it working in Firefox (very nicely, thank you), using the following code in the header.php file of the Minimalism theme (based on kubrick):<code><style><?php if(is_single()||is_page()):?>#header{background:url(<?php echo gt_get_image_url();?>)no-repeat bottom center;}<?php endif;?></style></code>But it does not work in Internet Explorer 7. This is what I see in the source code of the page generated by IE7:<code><style></style></code>Nothing between the style tags whereas in Firefox the page source looks right.In IE7 it uses the default header image. What do I need to do to make sure the unique header image shows up in IE?Thanks,Chrys


  53. Jean Says:

    Hello,This is a great plugin I appreciate it.
     
    I have installed it and updated that line you told me to on the wp-config.php, afterwards when you said“2.Go to Options->”GT Unique header Image”"I didn’t manage to find what you mean.
     
    I have edited a page of mine which I want to have a different header.
    after i edit it I get the message
     
    Warning: Cannot modify header information - headers already sent by (output started at /home2/getattra/public_html/goglobal/wp-config.php:35) in /home2/getattra/public_html/goglobal/wp-includes/pluggable.php on line 770
     
    When I come back to it though I see the the thumbmail of the image I want in my header but the page still has the default header.
     
    Can it be fixed?
     
    Regards,
    Jean
     
     


  54. Milad Says:

    I have a problem with this plugin,when I upload  a picture in my wordpress dashboard it goes white.
    so i am just wondering if it works with wordpress 2.7
    also where should i put <?php $image_url=get_get_image_url();?> ?
    thanks,


  55. brajesh Says:

    hi Chrys
    Sorry,because of holidays ,I could not reply.
    The issue you mentioned is not a problem with the plugin.This is something a css issue.Try to write style block as


    May be IE 7 is not understanding the style block without the type=”text/css”,so try that,may be it should solve your problem.


  56. brajesh Says:

    hi Jean
    are you using wordpress 2.7,In that case you need to go to settings(as wordpress has changed the names of different sections)->GT Unique header Image
    The error you are getting is because of some space issue.
    Please check your theme’s header.php or wp-config.php or theme’s functions.php has no spaces before the PHP tag,if there is any space ,remove that and save.It will work.


  57. brajesh Says:

    hi Milad
    Please check two things
    1.are you able to upload images using your wordpress Image uploader and are they showing correctly,If not you need to change some lines in htaccess ,as some security settings does not allow uploading files.
    2.If you are able to upload the file using your wordpress Image uploader,then please check ,have you set the correct permission for uploads directory.Does it allows writing file.If yes,there there should not be issue,If no,please change the permission to make 777.


Leave a Reply