Support » Theme: Grey Opaque » Define a custom header image for each page

  • kyrunn


    Hi “Odin”!

    First of all, great looking theme! Congrats!
    My question is, is there a way to add a custom header image for each page?
    I tried to create a custom field, and adding the value of an image url. But .. I don’t know how to insert the custom field into the code! I’m not that of a programming expert 😀

    I hope you can help me on this!
    Thank you very much!

Viewing 1 replies (of 1 total)
  • kyrunn


    Just a bit more information, the place where I could have put the code it’s in:

    <div id="masthead">
    <?php do_action('greyopaque_header'); ?>
    </div><!-- #masthead -->

    and that redirects me to the functions.php and.. that’s where I get lost.

    // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
    		if(!defined('HEADER_IMAGE')) {
    			define('HEADER_IMAGE', '%s/images/headers/header.png');
    		// The height and width of your custom header. You can hook into the theme's own filters to change these values.
    		// Add a filter to greyopaque_header_image_width and greyopaque_header_image_height to change these values.
    		define('HEADER_IMAGE_WIDTH', apply_filters('greyopaque_header_image_width', 960));
    		define('HEADER_IMAGE_HEIGHT', apply_filters('greyopaque_header_image_height', 300));

    I did some research and found out a code to make the custom field to work, I just don’t know how to apply it to make it work:

    <?php if(get_post_meta($post->ID, 'banner', true)) : ?>
    <img src="<?php echo get_post_meta($post->ID, 'banner', true); ?>" />
    <?php else : ?>
    <?php the_title(); ?>
    <?php endif; ?>

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Define a custom header image for each page’ is closed to new replies.