Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/5212723 to your computer and use it in GitHub Desktop.
Save braddalton/5212723 to your computer and use it in GitHub Desktop.
function specific_category_header_image(){
if(is_home())
echo '<div class="home-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
elseif(is_category(1) )
echo '<div class="category-one-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
elseif(is_category(2) )
echo '<div class="category-two-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
elseif(is_category(3) )
echo '<div class="category-three-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
elseif(is_category(4) )
echo '<div class="category-four-header"><img src="http://yourdomain.com/path/to/image.png" alt="category header image" /></div>';
}
add_action('genesis_header', 'specific_category_header_image');
/**
* @author Brad Dalton - WP Sites
* @example http://wpsites.net/web-design/display-custom-header-images-on-category-archive-pages/
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment