Support

Account

Home Forums Front-end Issues Display image full size not working on categories

Unread

Display image full size not working on categories

  • Hello

    I have a problem, I’m calling an image field in my header.

    My image X is called in a page and working well, but the same image called in a category looks blur. By checking in chrome it seems it’s limiting the image to 640px and use it as cover (I ask the object-fit:cover in css). It’s showing all image sizes but not apply the good one. So it’s using the 640px for 2000w, 800w, 768w….I have the same problem for every categories images in the headers.

    So it’s not a “non existing size ” problem in function.php.

    my code:

    
    <div id="fondHeader">
    
    		<?php if (is_front_page() ||  ($postID==687) || ($postID==1496)  || ($categoryID==3) )  {
    		
    
    			$imageFront = get_field('generique', options);
    			$sizeFront = 'full';
    			
    				echo wp_get_attachment_image( $imageFront, $sizeFront );	
    
    		} else if(is_category('2')){		
    
    			$imageBlog = get_field('categoriesBlog', options);
    			$sizeBlog = 'large';
    			
    				echo wp_get_attachment_image( $imageBlog, 2000);	
    
    			
    
    				} else if(is_category('4')){		
    			
    
    					$imageCat4 = get_field('portfolio', options);
    					$sizePortfolio = 'full';
    					
    					echo wp_get_attachment_image( $imageCat4, $sizePortfolio );			
    
    			 
    			}else{
    			the_post_thumbnail('full'); 
    			}?>
    		</div>
    
    
Viewing 1 post (of 1 total)

The topic ‘Display image full size not working on categories’ is closed to new replies.