WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Dynamic Headers

Dynamic Headers does just what you think it would based on the name - it allows you to create highly dynamic header space on your WordPress site.

Directions for Use

  1. After installing the plugin you will need to create /wp-content/header-images/ and make it writable. If you are unsure on how to do this, consult your hosting company, your help files for your hosting, your FTP client documentation, etc. This process can vary from server to server. If the directory is not writable you should be seeing an error message at the top of the plugin admin pages.
  2. Upload media (using the filtypes listed above) on the Add New File Page.
  3. Go to the Settings Page (under the Headers menu created by the plugin) and set your default header image. If you do not set a default header image, no media will be shown for posts and pages that do not have a header image associated with it.Alternatively, you can also add images to the /wp-content/header-images/ directory using your FTP client or other file manager.
  4. Create or edit a post or page and at the bottom of the page you will see a new box called "Dynamic Header by Nicasio Design". Select from the drop down one of your uploaded media files. This media will be shown only on the page or posts you set it to appear on.
  5. BACKUP YOUR THEME DIRECTORY BEFORE MAKING ANY MODIFICATIONS TO ANY THEME FILES
  6. Now you will need to add the template tag created by the plugin to your theme file where you want your dynamic header to appear (this will usually be in /wp-content/themes/your-theme-name/header.php).

You have 2 options for adding your dynamic header:

Option 1 (Recommended): Simply drop the this snippet of code into your theme file that controls your header (usually header.php)

Note: The location to add this code can vary widely from theme to theme and depending on your theme's css settings you may have to use Option 2 and modify the CSS of your theme BACKUP ANY THEME FILES BEFORE MODIFYING

<?php 
if(function_exists('show_media_header')){
show_media_header();
}
?>

This will automatically determine what type of media you are using and generate the appropriate code to insert it. No other coding is required on your part.

Option 2: You can use this line of code to simply get the URL of the media for a particular post or page. This will allow you to do some more advanced things and embed the media yourself if you know what you are doing.

<?php 
if(function_exists('dh_get_page_image_url')){
$dynamic_header_url = dh_get_page_image_url(); 
}
?>

You can then use the variable $dynamic_header_url however you see fit. It will contain the full path to your media file.

It is advised that most users simply use Option 1 as it is significantly more simple.

Note: This function can return NULL or the string "None" if there are no headers for the current page.

Important Notes: On archive pages, the header media is controlled by the first post in the list. We plan to add control for archives pages separately in a future release, but for now, be aware that the first post on an archives page controls that page's header.

Notes for Theme Developers

There are several functions/template tags you can use to customize your theme using Dynamic Headers. These could be used in unique ways to build custom CSS code around Dynamic Headers, or use your imagination.

dh_get_page_image_url() - This function will return the full URL of the header file for the page. Will be replacing get_media_header_url()

dh_get_page_link_url() - Will return the full URL for a link assigned to a header file, or an empty string, '', if there is none.

dh_get_page_link_target() - Will return the link target associated with a header file, or an empty string, '', if there is none.

dh_has_header() - Conditional function. Will return TRUE if the current page has a header explicitly assigned to it (not counting default headers) or FALSE if not.

dh_print_media_path() - Will print the relative path to the directory where Dynamic Header media files are stored.

dh_get_media_path() - Will return the relative path to the directory where Dynamic Header media files are stored.

dh_get_random_media_item() - Will return the URL of a random media item contained in the Dynamic Headers media directory

Requires: 2.7 or higher
Compatible up to: 3.0.5
Last Updated: 2010-10-4
Downloads: 148,549

Ratings

4 stars
4.5 out of 5 stars

Support

0 of 1 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
100,1,1 100,4,4
100,2,2
100,1,1
80,5,4 100,2,2 80,5,4
85,13,11
100,4,4
100,2,2 75,4,3 80,5,4
50,4,2
100,3,3
100,1,1
80,5,4
100,2,2
100,1,1
100,1,1
100,1,1
80,10,8
67,3,2
86,7,6
50,6,3
100,2,2
100,5,5
100,2,2
100,1,1
100,1,1
100,1,1