25. June 2012
von Blackbam

Why does WordPress need another Header Images Plugin? Really, there are a lot of Plugins for this purpose so why did I have to write another one? The answer is: All these plugins have a lot of code, it is hard to extend these by oneself and unfortunatly none if these is really simple to maintain, extend and to understand. I was searching for hours for the right header image Plugin which provides the functionality that i needed in a simple clean and easy way, without custom tables and buggy built-in uploads, wihout required theme support and so on. So here is my answer: A quick and easy WordPress Plugin to do this job.

Features

  • Simple and easy management of header images
  • Each possible state is covered, by using the WordPress template hierarchyfor diffentiation
  • The Media Library is used for image management, images are saved by URL copy/paste (so external images can be used, too)
  • Requires no extra tables
  • NEW: Support for Custom Post Types (Single Custom Post Images) and Custom Taxonomies (Taxonomy Page Images)
  • Clean install/uninstall
 
Be free to post improvement ideas and feature request as a comment to this post.

Installation

>> Download this Plugin <<

  1. Upload the Plugin to your wp-content/plugins/ folder
  2. Activate the Plugin
  3. Go to Settings -> Header Images and insert the image URLs (get the URLs from the media library)
  4. Paste one of the following codes into your theme:

NOTE:This code must be put into PHP brackets!

// standard code
if(function_exists('chi_display_header')) { chi_display_header(); }

or this code, use concrete numbers for width and height in pixels:

// f.e. chi_display_header(960,250); for header images with 960 px width and 250 px height
if(function_exists('chi_display_header')) { chi_display_header($width,$height); }

Warning: You can only use conditional query tags after the posts_selection action hook in WordPress (the wp action hook is the first one through which you can use these conditionals). For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function (http://codex.wordpress.org/Conditional_Tags).

 

============ UPDATE: 2014-02-01 ==========

Some functions were added for better flexibility:


chi_get_header_image_url(); // get only the URL of the header image

 


chi_get_header_image_link(); // get only the Link of the header image

 


chi_get_display_header_data($width=-1,$height=-1); // get the full output of the plugin into a variable, but do not display it

 

Responsiveness tutorial (short)

For the sake of responsive web design, you will not be happy to put out the same header image on every device (as huge header images are not good for mobile devices to load). Therefore I suggest the following solution which should work well for you:

 

  1. Instead of calling  chi_display_header(); you call chi_get_header_image_url(); and pass it to a Javascript variablet
  2. Install the timthumb library on your WordPress installation
  3. Use Javascript to get the image in the desired size from timthumb.php by passing the original image url

 

How to change header images...

  • Go to Settings ->Header images (general images)
  • Meta Boxes at the bottom of post / page edit screen
  • Category add/edit screen

FAQ

Q: The Plugin is not displaying the header images correctly. What is wrong?

  • The function code must be pasted into one of your template files, the best place in most cases of use is the bottom of header.php
  • This Plugin uses conditional tags. Please make sure that your wp_query object has been loaded correctly, before the code is executed.
Share

Dieser Eintrag wurde am 25. June 2012 um 1:01 in der Kategorie Plugins, WordPress veröffentlicht. You can book the comments for this article RSS 2.0. Feedback, discussion, commendation and critics are welcome: Write a comment or trackback.


Tags:

Already 93 comments belonging to "Custom Header Images Plugin for WordPress":

Kommentare abonnieren (RSS) or URL Trackback

Blackbam     says:

on 02. May 2013 at 19:58 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 21. May 2013 at 06:24 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 21. May 2013 at 13:04 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. June 2013 at 10:36 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. June 2013 at 19:42 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 12. June 2013 at 13:52 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 09. July 2013 at 23:50 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 17. July 2013 at 23:14 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 24. July 2013 at 12:37 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 25. July 2013 at 16:29 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 09. August 2013 at 05:01 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. August 2013 at 15:21 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 19. August 2013 at 11:45 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 23. September 2013 at 08:03 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 23. September 2013 at 21:51 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 24. September 2013 at 20:36 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 06. November 2013 at 18:56 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 02. January 2014 at 11:57 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 08. January 2014 at 20:49 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 09. January 2014 at 16:46 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 28. January 2014 at 11:13 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 28. January 2014 at 20:09 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 29. January 2014 at 11:17 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 08. February 2014 at 23:21 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 16. February 2014 at 17:26 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 19. February 2014 at 16:14 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 20. February 2014 at 09:06 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 24. February 2014 at 14:56 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 01. April 2014 at 20:24 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 02. April 2014 at 19:21 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. May 2014 at 21:07 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 02. October 2014 at 17:01 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 03. October 2014 at 16:56 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 27. December 2014 at 22:14 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 27. December 2014 at 22:49 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 07. January 2015 at 23:52 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 09. January 2015 at 00:35 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 03. March 2015 at 21:56 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. April 2015 at 21:42 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. April 2015 at 21:43 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 11. April 2015 at 21:48 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 14. August 2015 at 07:16 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Blackbam     says:

on 16. September 2015 at 16:08 on clock


Hello,

you should make sure that the following:

1. Links must be enabled, the link must be correctly specified (if it is working for most of the images, but not for a specific one this might be a bug, please report it)
2. If you use custom output, make sure that you use the [link] shorttag properly in your output - if not, please try again with using custom output and tell me, if this solved the problem - the linking functionality is basically the same as the images functionality, so if the images work, the links should work, too.

Hope this helps.

Leave a comment: