$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>post thumbnails - Missing image size|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

post thumbnails - Missing image size

matteradmin9PV0评论

I have added a couple of custom sizes to my wordpress environment with the following code:

add_image_size( "maximal", "1900" );
add_image_size( "desktop", "1400" );
add_image_size( "tablet", "900" );
add_image_size( "smalltablet", "700" );
add_image_size( "mobile", "500" );
add_theme_support( 'post-thumbnails' ); 

but when I call an image, the 1900px version is always missing:

<img src="test.laurentwillen.be/pixel.gif" class="attachment-mobile size-mobile wp-post-image" alt="Xiaomi Mi 8 Lite test, avis et prix" srcset=".jpg 500w, .jpg 300w, .jpg 768w, .jpg 1024w, .jpg 1400w, .jpg 900w, .jpg 700w" width="100%">

In the end I see the following formats in my images: 300, 500, 700, 768, 900, 1024, 1400

I should probably remove the old WP sizes but I really don't get why I'm not getting the 1900px format even if I visit a page on a 2k screen. The consequence is that people with a resolution around 1600 and more get lower quality images.

Do you have any idea of what I should do to have those 1900px images ? I already regenerated my thumbnails.

Thanks

Laurent

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far