Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #83700
    eggbanana
    Participant

    Hello,

    I’d like to be able to add a specific header image to a category page. I’ve tried using a plugin (Category Featured Images), and this allows me to choose a header image. But when I navigate to a category page, my featured image isn’t recognized. Instead, it displays the same header image as my home page.

    The posts pages have their own featured header; no problems there. I’ve tried the various options available in the customiser (enable header on entire site, posts/pages etc.)

    Thanks!

    #83708
    Mahesh
    Participant

    Hi @eggbanana,

    This option is not available in our theme. Seems you’ve used Category Featured Image plugin, please contact Category Featured Image plugin’s support. This is out of theme support scope.

    Regards,
    Mahesh

    #83710
    eggbanana
    Participant

    Thanks Mahesh,

    Is there a way to have an option, in the customiser, to ‘enable featured header’ on ‘Homepage,Page/Post Featured Image’?

    Cheers

    #83751
    Mahesh
    Participant

    Hi @eggbanana,

    Please create a child theme. Check this LINK to find more details on creating child theme. Activate child theme. Then in child theme’s functions.php add the following codes.

    /**
     * Modify Parent function to display header in Homepage and Post/Page.
     *
     */
    function fullframe_featured_overall_image() {
    		global $post, $wp_query;
    		$options				= fullframe_get_theme_options();
    		$defaults 				= fullframe_get_default_theme_options();
    		$enableheaderimage 		= $options['enable_featured_header_image'];
    
    		// Get Page ID outside Loop
    		$page_id = $wp_query->get_queried_object_id();
    
    		$page_for_posts = get_option('page_for_posts');
    
    		if ( is_home() || is_singular() ) {
    
    		// Check Enable/Disable header image in Page/Post Meta box
    		if ( is_page() || is_single() ) {
    			//Individual Page/Post Image Setting
    			$individual_featured_image = get_post_meta( $post->ID, 'fullframe-header-image', true );
    
    			if ( $individual_featured_image == 'disable' || ( $individual_featured_image == 'default' && $enableheaderimage == 'disable' ) ) {
    				echo '<!-- Page/Post Disable Header Image -->';
    				return;
    			}
    			elseif ( $individual_featured_image == 'enable' && $enableheaderimage == 'disabled' ) {
    				fullframe_featured_page_post_image();
    			}
    		}
    
    		// Check Homepage
    		if ( $enableheaderimage == 'homepage' ) {
    			if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
    				fullframe_featured_image();
    			}
    		}
    		// Check Excluding Homepage
    		if ( $enableheaderimage == 'exclude-home' ) {
    			if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
    				return false;
    			}
    			else {
    				fullframe_featured_image();
    			}
    		}
    		elseif ( $enableheaderimage == 'exclude-home-page-post' ) {
    			if ( is_front_page() || ( is_home() && $page_for_posts != $page_id ) ) {
    				return false;
    			}
    			elseif ( is_page() || is_single() ) {
    				fullframe_featured_page_post_image();
    			}
    			else {
    				fullframe_featured_image();
    			}
    		}
    		// Check Entire Site
    		elseif ( $enableheaderimage == 'entire-site' ) {
    			fullframe_featured_image();
    		}
    		// Check Entire Site (Post/Page)
    		elseif ( $enableheaderimage == 'entire-site-page-post' ) {
    			if ( is_page() || is_single() ) {
    				fullframe_featured_page_post_image();
    			}
    			else {
    				fullframe_featured_image();
    			}
    		}
    		// Check Page/Post
    		elseif ( $enableheaderimage == 'pages-posts' ) {
    			if ( is_page() || is_single() ) {
    				fullframe_featured_page_post_image();
    			}
    		}
    		else {
    			echo '<!-- Disable Header Image -->';
    		}
    	}
    	else{
    		return;
    	}
    }

    Then go to “Dashboard=> Appearance=> Customize=> Header Image” and select “Entire Site, Page/Post Featured Image” in Enable Featured Header Image on dropdown.

    Regards,
    Mahesh

    #83839
    eggbanana
    Participant

    Thank you so much! That worked great.

    #83865
    Mahesh
    Participant

    Hi @eggbanana,

    Thank you for your appreciation.
    Have a good day!

    Regards,
    Mahesh

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Header image on category page.’ is closed to new replies.