Viewing 8 posts - 21 through 28 (of 28 total)
  • Author
    Posts
  • #26191
    Jonathan
    Member

    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?

    #26919
    Jonathan
    Member

    Also, 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.

    #26968
    Sakin
    Keymaster

    @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
    #26974
    Jonathan
    Member

    Great 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.

    #26976
    Sakin
    Keymaster

    @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 );
    #26979
    Jonathan
    Member

    that made my site go all white again…

    #26980
    Jonathan
    Member

    Sorry 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?

    #26987
    Sakin
    Keymaster

    @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.

Viewing 8 posts - 21 through 28 (of 28 total)
  • The topic ‘Different Header for Different Pages’ is closed to new replies.