• Hi,

    How can I register featured images for specific page templates

    I tried this but does not work.
    I will only register more featured images for default WP posts.

    function features_image_2($featured_images) {
    	if (is_page_template( 'single-templateA.php' )) {
    		$args = array(
    				'id' => 'featured-image-2',
    				'desc' => 'Test.',
    				'label_name' => 'Featured Image 2',
    				'label_set' => 'Set Featured Image 2',
    				'label_remove' => 'Remove Featured Image 2',
    				'label_use' => 'Set Featured Image 2',
    				'post_type' => array( 'post' ),
    		);
    
    		$featured_images[] = $args;
    
    		return $featured_images;
    	}
    }
    add_filter( 'kdmfi_featured_images', 'features_image_2');
  • The topic ‘Assign features images depending on page template’ is closed to new replies.