Advertisement
arie_cristianD

override single post featured imgae size

May 26th, 2025
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1.  
  2. add_filter( 'wp_get_attachment_image_src', 'change_featured_size', 99, 4 );
  3.  
  4. function change_featured_size( $image, $attachment_id, $size, $icon ) {
  5.     if ( 'jnews-featured-750' === $size ) {
  6.         $full_size = image_downsize( $attachment_id, 'full' );
  7.         if ( $full_size ) {
  8.             return $full_size;
  9.         }
  10.     }
  11.  
  12.     return $image;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement