{"id":123595,"date":"2013-11-23T11:30:10","date_gmt":"2013-11-23T16:30:10","guid":{"rendered":"http:\/\/wpmu.org\/?p=123595"},"modified":"2013-11-24T18:06:38","modified_gmt":"2013-11-24T23:06:38","slug":"how-to-turn-on-cropping-for-thumbnails-in-wordpress","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/how-to-turn-on-cropping-for-thumbnails-in-wordpress\/","title":{"rendered":"How to Turn On Cropping for Thumbnails in WordPress"},"content":{"rendered":"<p>Do thumbnail images on your site look all squashed? Maybe all the people in your photos look super skinny or extra wide?<\/p>\n<p>In today&#8217;s Weekend WordPress Project, I&#8217;ll show you a quick and easy way to crop your thumbnails instead of scaling them.<!--more--><\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-ratio-large wp-image-123608\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/11\/feature-thumbnails-700x218.jpg\" alt=\"Thumbnails feature image\" width=\"700\" height=\"218\" \/><\/div>\n<\/div>\n<p>To crop thumbnail images for different sizes, just add the following code to your functions.php file:<\/p>\n<p><code><br \/>\n\/\/ Standard Size Thumbnail<br \/>\nif(false === get_option(\"thumbnail_crop\")) {<br \/>\nadd_option(\"thumbnail_crop\", \"1\"); }<br \/>\nelse {<br \/>\nupdate_option(\"thumbnail_crop\", \"1\");<br \/>\n}<\/code><\/p>\n<p>\/\/ Medium Size Thumbnail<br \/>\nif(false === get_option(&#8220;medium_crop&#8221;)) {<br \/>\nadd_option(&#8220;medium_crop&#8221;, &#8220;1&#8221;); }<br \/>\nelse {<br \/>\nupdate_option(&#8220;medium_crop&#8221;, &#8220;1&#8221;);<br \/>\n}<\/p>\n<p>\/\/ Large Size Thumbnail<br \/>\nif(false === get_option(&#8220;large_crop&#8221;)) {<br \/>\nadd_option(&#8220;large_crop&#8221;, &#8220;1&#8221;); }<br \/>\nelse {<br \/>\nupdate_option(&#8220;large_crop&#8221;, &#8220;1&#8221;);<br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n<p>Thanks to <a title=\"Activate cropping for all thumbnail sizes\" href=\"http:\/\/wp-snippet.com\/snippets\/activate-cropping-for-all-thumbnail-sizes\/\" rel=\"noopener\" target=\"_blank\">WP-Snippet<\/a> for this handy tip!<\/p>\n<p>Have a great weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do thumbnail images on your site look all squashed? Maybe all the people in your photos look super skinny or extra wide? In today&#8217;s Weekend WordPress Project, I&#8217;ll show you a quick and easy way to crop your thumbnails instead of scaling them.<\/p>\n","protected":false},"author":164650,"featured_media":123608,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[],"tutorials_categories":[],"class_list":["post-123595","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/123595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/164650"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=123595"}],"version-history":[{"count":1,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/123595\/revisions"}],"predecessor-version":[{"id":216023,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/123595\/revisions\/216023"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/123608"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=123595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=123595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=123595"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=123595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}