- This topic has 27 replies, 3 voices, and was last updated 10 years ago by Sakin.
-
AuthorPosts
-
April 18, 2014 at 2:36 pm #26191JonathanMember
Thank you for the reply again. Yes I am perplexed as to why the plugin wont work with pro. It is called “Custom Header Extended” and I have switched back to the free version and now it is working the way I want it. (www.point-of-view.ca)
I want to have different header images just for the different pages and posts but I want to be able to chose which one for each without affecting the featured image. Can you think of any reason why the plugin won’t work?
April 22, 2014 at 8:42 pm #26919JonathanMemberAlso, I tried it the way you said but when I choose to have the default as the header image it still shows the featured image for some reason. I can’t understand why.
April 23, 2014 at 12:46 am #26968SakinKeymaster@Jonathan: Ok is this is not working for you then you can build child theme and create functions.php file and add the following code
<?php /** * Header Image * * Uses Custom Header and Featued Images * @Hooked in catchevolution_headercontent * @since Catch Evolution 1.0 */ function catchevolution_featured_header() { global $wp_query, $post, $paged, $_wp_default_headers; // Header Image $header_image_path = get_header_image(); // Check if this is a post or page, if it has a thumbnail, and if it's a big one if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) && $image[1] >= HEADER_IMAGE_WIDTH ) : // Houston, we have a new header image! echo '<div id="header-image">'; echo get_the_post_thumbnail( $post->ID ); echo '</div>'; elseif ( get_header_image() ) : ?> <div id="header-image"> <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /> </div> <?php endif; } // catchevolution_featured_header
April 23, 2014 at 12:52 am #26974JonathanMemberGreat that seems to be working and what I wanted it to do. But one small thing. The header text that used to be above the image is now below….can I switch that back? Also just so I know this code overrides the featured images in post correct?
Thank for the help.
p.s. please ignore my post on the other thread I just made.
April 23, 2014 at 1:01 am #26976SakinKeymaster@Jonathan: Then add the following code just in your functions.php file. You can place this code below the previous code.
// Remove hook from parent theme function unhook_catchevolution_functions() { remove_action( 'catchevolution_before', 'catchevolution_featured_header', 10 ); } add_action( 'init', 'unhook_catchevolution_functions' ); add_action( 'catchevolution_after_header', 'catchevolution_featured_header', 10 );
April 23, 2014 at 1:06 am #26979JonathanMemberthat made my site go all white again…
April 23, 2014 at 1:10 am #26980JonathanMemberSorry my mistake that worked great! Thanks that was really troubling me. Weird why the plugin wouldn’t work. With the plugin I could chose what header image I wanted for each individual post. Do you think there ill be an update for the pro so that it works like it does for the free version?
April 23, 2014 at 1:35 am #26987SakinKeymaster@Jonathan: Actually that plugin conflict with our functions. So, we cannot add this. But yes you can use this child theme and it’s all good.
-
AuthorPosts
- The topic ‘Different Header for Different Pages’ is closed to new replies.