{"id":62812,"date":"2016-10-21T18:01:43","date_gmt":"2016-10-21T18:01:43","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=62812"},"modified":"2024-11-28T11:20:27","modified_gmt":"2024-11-28T11:20:27","slug":"generating-multiple-image-sizes-wordpress","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/","title":{"rendered":"Generating multiple image sizes in wordPress"},"content":{"rendered":"\n<p>Hello everyone today we will discuss about generating multiple image sizes for a single uploaded image. But now the question is why do someone need more than one image size for a single\u00a0uploaded image. <\/p>\n\n\n\n<p>It is very obvious that nowadays wordPress theme developers or designers are dealing with different kind of layouts where a single image is presented in different ways. like for eg. may be in post page the blog image is a small one and in single page the same image is large in size. You can check <a href=\"https:\/\/blog.uvdesk.com\">Uvdesk Blog<\/a>\u00a0as an example where we have used same image with different sizes.<\/p>\n\n\n\n<p>Let&#8217;s start with writing the code :-<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php \n add_theme_support( &#039;post-thumbnails&#039; ); \/\/ support of post thumbnails \n?&gt;<\/pre>\n\n\n\n<p>You have to<\/p>\n\n\n\n<p>now for adding multiple image sizes use below function provided by wordpress<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nadd_image_size( &#039;author-page-thumbnail&#039;, 140, 140, true ); \/\/ Hard Crop Mode\nadd_image_size( &#039;post-page-thumbnail&#039;, 240, 280 ); \/\/ Soft Crop Mode\nadd_image_size( &#039;single-page-thumbnail&#039;, 600, 9999 ); \/\/ Unlimited Height Mode\n?&gt;<\/pre>\n\n\n\n<p>please look at the comments&nbsp;specified three different sort of image sizes.tree different images with different modes&nbsp;such as hard crop, soft crop, and unlimited height.<\/p>\n\n\n\n<p>Hard Crop:- It tells wordPress that to crop the image to the size that we have defined. it is basically used when you want every image of same proportion or size<\/p>\n\n\n\n<p>Soft Crop :- By Default this option&nbsp;is on for wordPress. According to this option&nbsp;image is resized and disortion of any imge is removed . it basically updates the width and height of the image is changed according to proportion with the width.<\/p>\n\n\n\n<p>Height Infinity&nbsp;:- &nbsp;In this&nbsp;option The width of the image is changed but the height remains what it was&nbsp;orignally there will be no changes in what so ever the width changes.<\/p>\n\n\n\n<p>Now the last question is how to use these various sizes of images on different pages . Here is the code below<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php \n the_post_thumbnail( &#039;your-specified-image-size&#039; ); \n?&gt;<\/pre>\n\n\n\n<p>use this method in post page or author page or single page with the <strong>specified image size name.<\/strong><\/p>\n\n\n\n<p>Once you have done this process and someone uploads an image for a blog then that image will automatically gene<\/p>\n\n\n\n<p>That\u2019s all for&nbsp;<strong>Generating multiple image sizes in wordPress<\/strong>, still have any issue feel free to add a ticket and let us know your views to make the code better <a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone today we will discuss about generating multiple image sizes for a single uploaded image. But now the question is why do someone need more than one image size for a single\u00a0uploaded image. It is very obvious that nowadays wordPress theme developers or designers are dealing with different kind of layouts where a single <a href=\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":67,"featured_media":62819,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1260],"tags":[3855,3854,3856,3857],"class_list":["post-62812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-create-multiple-image-sizes-wordpress","tag-generate-multiple-image-size","tag-multiple-image-sizes-wordpress","tag-post-thumbnail-multiple-image-sizes"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Generating multiple image sizes in WordPress<\/title>\n<meta name=\"description\" content=\"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Generating multiple image sizes in WordPress\" \/>\n<meta property=\"og:description\" content=\"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-21T18:01:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-28T11:20:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Webkul\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Webkul\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\"},\"author\":{\"name\":\"Webkul\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02\"},\"headline\":\"Generating multiple image sizes in wordPress\",\"datePublished\":\"2016-10-21T18:01:43+00:00\",\"dateModified\":\"2024-11-28T11:20:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\"},\"wordCount\":374,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png\",\"keywords\":[\"create multiple image sizes wordpress\",\"generate multiple image size\",\"multiple image sizes wordpress\",\"post thumbnail multiple image sizes\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\",\"url\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\",\"name\":\"Generating multiple image sizes in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png\",\"datePublished\":\"2016-10-21T18:01:43+00:00\",\"dateModified\":\"2024-11-28T11:20:27+00:00\",\"description\":\"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png\",\"width\":825,\"height\":260,\"caption\":\"Creating New shipping method in woocommerce\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generating multiple image sizes in wordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02\",\"name\":\"Webkul\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Webkul\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/amit098\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Generating multiple image sizes in WordPress","description":"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Generating multiple image sizes in WordPress","og_description":"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress","og_url":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-10-21T18:01:43+00:00","article_modified_time":"2024-11-28T11:20:27+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png","type":"image\/png"}],"author":"Webkul","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Webkul","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/"},"author":{"name":"Webkul","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02"},"headline":"Generating multiple image sizes in wordPress","datePublished":"2016-10-21T18:01:43+00:00","dateModified":"2024-11-28T11:20:27+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/"},"wordCount":374,"commentCount":1,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png","keywords":["create multiple image sizes wordpress","generate multiple image size","multiple image sizes wordpress","post thumbnail multiple image sizes"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/","url":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/","name":"Generating multiple image sizes in WordPress","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png","datePublished":"2016-10-21T18:01:43+00:00","dateModified":"2024-11-28T11:20:27+00:00","description":"Enable the support of post thumbnails in WordPress and use the add_images_size() function to generate multiple image sizes in WordPress","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/10\/WordPress-Code-Snippet-1.png","width":825,"height":260,"caption":"Creating New shipping method in woocommerce"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/generating-multiple-image-sizes-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Generating multiple image sizes in wordPress"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02","name":"Webkul","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Webkul"},"url":"https:\/\/webkul.com\/blog\/author\/amit098\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=62812"}],"version-history":[{"count":9,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62812\/revisions"}],"predecessor-version":[{"id":475856,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/62812\/revisions\/475856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/62819"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=62812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=62812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=62812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}