2017-05-04 48 views
0

我有圖像縮略圖的URL訪問權限。現在,我想根據網址上的縮略圖圖像獲取最大的圖像,但我找不到這張最大的圖像。如何根據縮略圖在wordpress中獲得最大的圖像

我檢查了wordpress圖片大小,並看到最大的圖像是1024x1024。我的形象是:

www.domain.com/wp-content/uploads/2017-04-sample-image-370x370.jpg

我試圖尺寸更改爲:

www.domain.com/wp-content/uploads/2017-04-sample-image-1024x1024.jpg

但是,它沒有按照我的預期工作。另外,我在產品和媒體庫中搜索了圖像名稱,但無法找到它。

有沒有辦法做到這一點?

回答

0

結賬the_post_thumbnail()。它允許你指定你想要的大小:例如

https://developer.wordpress.org/reference/functions/the_post_thumbnail/

// without parameter -> Post Thumbnail (as set by theme using set_post_thumbnail_size()) 
the_post_thumbnail(); 

the_post_thumbnail('thumbnail');  // Thumbnail (default 150px x 150px max) 
the_post_thumbnail('medium');   // Medium resolution (default 300px x 300px max) 
the_post_thumbnail('large');   // Large resolution (default 640px x 640px max) 
the_post_thumbnail('full');   // Original image resolution (unmodified) 

the_post_thumbnail(array(100,100)); // Other resolutions 

來源:https://codex.wordpress.org/Post_Thumbnails

相關問題