sandywp / plugins / wp-display-header

WP Display Header

4.5 out of 5 stars. 4.5 27 reviews

Select a specific header or random header image for each content item or archive page.

Launch a sandbox with this plugin → No signup.
Ready in seconds.

v9 7,000+ installs WP 3.2+ PHP 7.4+

your-sandbox.sandywp.com/wp-admin
WP Display Header running inside a SandyWP sandbox

What you get inside

2 screens
  • The meta box in the main column.

  • The meta box in the side column.

About this plugin

This plugin lets you specify a header image for each post, page, custom post type or archive page individually, from your default headers and custom headers.

It adds a meta box in the post edit screens with the header selection and a settings field in the edit profile and each taxonomy edit screen.
If no specific header is specified for a post it will fall back to the default selection.
There is no change of template files necessary as this plugin hooks in the existing WordPress API to unfold its magic.

Thanks to Erik T. for the idea to this plugin!

Questions

What do I need in the `header.php` file to make the plugin work seamlessly?

To make it work in your header.php file all you need is a header_image() call like so:

<img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />

See TwentyTwelve’s header.php for reference.

Plugin Filter Hooks

wpdh_show_default_header (bool)

Whether to show the default header (true) or to look for a specifically selected header for the current request.

wpdh_get_header_posts (array)

All attachments with the meta key _header_image. An array with the query vars.

wpdh_get_headers (array)

The array with all registered headers.

wpdh_get_active_post_header (string)

The url to the currently active header image.

4.5

27 reviews

  • 5 ★ 22
  • 4 ★ 1
  • 3 ★ 2
  • 2 ★ 0
  • 1 ★ 2

Ratings come from WordPress.org. SandyWP does not collect its own reviews.

sandywp / also on the shelf

Try another plugin

  • Unique Headers

    4.9 · 10K+ installs

    Add unique custom header images to individual pages, posts, categories, or tags.

  • WP Header Images

    4.4 · 5K+ installs

    A great WordPress plugin which helps you to choose a unique image for each menu page.

  • Header Enhancement

    3.5 · 600+ installs

    Header Enhancement allows you to add an expressive custom header video on your website with features like mobile compatibility…

Spin up a real WordPress site in seconds.

Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.