Add Custom Header Images

Description

A plugin that should be able to remove default headers for a theme and add custom headers based upon the article written by Julio Biason who was inspired by wpti.ps.

Create a Page named The Headers. Then upload header images (media files) to the the page. The page may have a visibility of private.

Once the custom header images are loaded, just go to Appearance > Header or Customize > Header Image and select Randomize suggested headers.

The plugin will display an error notice if there is not a page titled, The Headers.

Attribution

Thanks to Andrijana Nikolic at Web Hosting Geeks for translation help.

Installation

  1. Create a new page. It can be private. It must be titled The Headers. Add any images that you want to use as custom header images to this page. Header images should be cropped appropriately for the base theme.
  2. Upload add-custom-header-images directory to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Go to Appearance > Header or Customize > Header Image and select Randomize from the Default Images section.

FAQ

Installation Instructions
  1. Create a new page. It can be private. It must be titled The Headers. Add any images that you want to use as custom header images to this page. Header images should be cropped appropriately for the base theme.
  2. Upload add-custom-header-images directory to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. Go to Appearance > Header or Customize > Header Image and select Randomize from the Default Images section.

Reviews

Great, except default 2011 header images show up.

I am using Add Custom Header Images with the WordPress Twenty Eleven theme. It works great except that there seems to be a bug. The Twenty Eleven theme comes with a number of default header images that show up along with the images I had uploaded to the “The Headers” page for the plugin to use.

I did a hack to fix this using a tip from Voodoo Press: http://voodoopress.com/adding-and-removing-default-headers-in-twentyeleven/

// REMOVE SOME DEFAULT HEADERS
function voodoo_header_out() {
    unregister_default_headers( array(
        'wheel',
        'shore',
        'trolley')
    );
}
add_action( 'after_setup_theme', 'voodoo_header_out', 11 );

If you do this, be aware that the array of default images in the example is incomplete. You will have to add the rest of them.

Read all 2 reviews

Contributors & Developers

“Add Custom Header Images” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.6.0

  • don’t run from constructor
  • requires PHP 5.3, sorta

1.5.2

  • use class variables to hold title and page data to reduce number of calls to database

1.5.1

  • set after_theme_setup hook to use later priority to ensure $_wp_default_headers is set, fixes removal of default images

1.5.0

  • removed specific srcset code as it was unnecessary and caused failures. srcset needs to be set correctly in header.php

1.4.2

  • fixed malformed closing strong tag in error message

1.4.1

  • escape translations of page name

1.4.0

  • added srcset for responsive image sizes
  • tested and updated for WP 4.4.0

1.3.3

  • tested to 4.3

1.3.2

  • load textdomain early so translations work.

1.3.1

  • fix readme.txt as plugin name generic
  • simplify warning, remove nested if statements
  • update .pot

1.3.0

  • better i18n strings, updated POT

1.2.0

  • move remove_default_header_images to run only if The Headers page is present. Should fix a PHP Notice too.

1.1.0

  • remove deactivate_plugins to and just display an error notice for better compatibility.

1.0.4

  • added some error checking

1.0.3

  • more graceful exit and return

1.0.2

  • exit after deactivating plugin when not able to be activated

1.0.1

  • Add .pot files
  • Fix short description by removing Markdown

1.0.0

  • Initial commit to WordPress repository