{"id":6297,"date":"2016-06-13T13:27:39","date_gmt":"2016-06-13T17:27:39","guid":{"rendered":"https:\/\/themespress.ca\/?p=6297"},"modified":"2022-09-09T06:16:11","modified_gmt":"2022-09-09T10:16:11","slug":"crop-resize-images","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/crop-resize-images\/","title":{"rendered":"Crop \/ Resize images in WordPress templates"},"content":{"rendered":"<p>This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images.<\/p>\n<p>It allows us to avoid using primary WordPress functions such as adding <strong>add_image_size<\/strong>. We also need to develop the way we will display thumbnail images and image attached to WordPress queries.<\/p>\n<p>Here are the 3 files included with <strong>Crop \/ Resize images<\/strong>:<br \/>\nthumb.php &#8211; <strong>Crop and resize function<\/strong><br \/>\nfunctions.php &#8211; <strong>Requires thumb.php<\/strong><br \/>\nresults.php &#8211; <strong>Displays Thumbnails and WordPress attachments in various formats.<\/strong><\/p>\n<p>No known conflicts<\/p>\n<h2>Crop \/ Resize images<\/h2>\n<p><a class=\"more\" href=\"https:\/\/themespress.ca\/produits\/ressources\/crop-resize-images-wordpress\/\">Crop \/ Resize WordPress images<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding<\/p>\n<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/crop-resize-images\/\">Read More<\/a><\/div>\n","protected":false},"author":81,"featured_media":4533,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[318],"class_list":["post-6297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-functions"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Daniel\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/themespress.ca\/en\/crop-resize-images\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Themespress - Des tutoriels et ressources WordPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Crop \/ Resize images in WordPress templates - Themespress\" \/>\n\t\t<meta property=\"og:description\" content=\"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/themespress.ca\/en\/crop-resize-images\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-06-13T17:27:39-04:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-09-09T10:16:11-04:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Crop \/ Resize images in WordPress templates - Themespress\" \/>\n\t\t<meta name=\"twitter:description\" content=\"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#blogposting\",\"name\":\"Crop \\\/ Resize images in WordPress templates - Themespress\",\"headline\":\"Crop \\\/ Resize images in WordPress templates\",\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/wsi-imageoptim-Crop-Resize-images-Wordpress-dans-les-templates-e1465828146627.jpg\",\"width\":895,\"height\":389},\"datePublished\":\"2016-06-13T13:27:39-04:00\",\"dateModified\":\"2022-09-09T06:16:11-04:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#webpage\"},\"articleSection\":\"Tutorials, Functions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#listItem\",\"name\":\"Crop \\\/ Resize images in WordPress templates\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#listItem\",\"name\":\"Accueil\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#listItem\",\"position\":3,\"name\":\"Crop \\\/ Resize images in WordPress templates\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/categorie\\\/tutorials\\\/#listItem\",\"name\":\"Tutorials\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Daniel\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#webpage\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/\",\"name\":\"Crop \\\/ Resize images in WordPress templates - Themespress\",\"description\":\"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/author\\\/daniel\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/themespress.ca\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/wsi-imageoptim-Crop-Resize-images-Wordpress-dans-les-templates-e1465828146627.jpg\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#mainImage\",\"width\":895,\"height\":389},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/crop-resize-images\\\/#mainImage\"},\"datePublished\":\"2016-06-13T13:27:39-04:00\",\"dateModified\":\"2022-09-09T06:16:11-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/themespress.ca\\\/en\\\/\",\"name\":\"Themespress\",\"description\":\"Des tutoriels et ressources WordPress\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/themespress.ca\\\/en\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Crop \/ Resize images in WordPress templates - Themespress","description":"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included","canonical_url":"https:\/\/themespress.ca\/en\/crop-resize-images\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#blogposting","name":"Crop \/ Resize images in WordPress templates - Themespress","headline":"Crop \/ Resize images in WordPress templates","author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2017\/02\/wsi-imageoptim-Crop-Resize-images-Wordpress-dans-les-templates-e1465828146627.jpg","width":895,"height":389},"datePublished":"2016-06-13T13:27:39-04:00","dateModified":"2022-09-09T06:16:11-04:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#webpage"},"isPartOf":{"@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#webpage"},"articleSection":"Tutorials, Functions"},{"@type":"BreadcrumbList","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","position":1,"name":"Accueil","item":"https:\/\/themespress.ca\/en\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","position":2,"name":"Tutorials","item":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/","nextItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#listItem","name":"Crop \/ Resize images in WordPress templates"},"previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/#listItem","name":"Accueil"}},{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#listItem","position":3,"name":"Crop \/ Resize images in WordPress templates","previousItem":{"@type":"ListItem","@id":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/#listItem","name":"Tutorials"}}]},{"@type":"Organization","@id":"https:\/\/themespress.ca\/en\/#organization","name":"Themespress","description":"Des tutoriels et ressources WordPress","url":"https:\/\/themespress.ca\/en\/"},{"@type":"Person","@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author","url":"https:\/\/themespress.ca\/en\/author\/daniel\/","name":"Daniel","image":{"@type":"ImageObject","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93cd2188e40b3289d305e88acb676eb8b84078e50e06f4eb38a0152903b34c9d?s=96&d=mm&r=g","width":96,"height":96,"caption":"Daniel"}},{"@type":"WebPage","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#webpage","url":"https:\/\/themespress.ca\/en\/crop-resize-images\/","name":"Crop \/ Resize images in WordPress templates - Themespress","description":"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/themespress.ca\/en\/#website"},"breadcrumb":{"@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#breadcrumblist"},"author":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"creator":{"@id":"https:\/\/themespress.ca\/en\/author\/daniel\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/themespress.ca\/wp-content\/uploads\/2017\/02\/wsi-imageoptim-Crop-Resize-images-Wordpress-dans-les-templates-e1465828146627.jpg","@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#mainImage","width":895,"height":389},"primaryImageOfPage":{"@id":"https:\/\/themespress.ca\/en\/crop-resize-images\/#mainImage"},"datePublished":"2016-06-13T13:27:39-04:00","dateModified":"2022-09-09T06:16:11-04:00"},{"@type":"WebSite","@id":"https:\/\/themespress.ca\/en\/#website","url":"https:\/\/themespress.ca\/en\/","name":"Themespress","description":"Des tutoriels et ressources WordPress","inLanguage":"en-US","publisher":{"@id":"https:\/\/themespress.ca\/en\/#organization"}}]},"og:locale":"en_US","og:site_name":"Themespress - Des tutoriels et ressources WordPress","og:type":"article","og:title":"Crop \/ Resize images in WordPress templates - Themespress","og:description":"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included","og:url":"https:\/\/themespress.ca\/en\/crop-resize-images\/","article:published_time":"2016-06-13T17:27:39-04:00","article:modified_time":"2022-09-09T10:16:11-04:00","twitter:card":"summary","twitter:title":"Crop \/ Resize images in WordPress templates - Themespress","twitter:description":"This tutorial will set up something similar of TimThumb where you can efficiently crop and resize WordPress images. It allows us to avoid using primary WordPress functions such as adding add_image_size. We also need to develop the way we will display thumbnail images and image attached to WordPress queries. Here are the 3 files included"},"aioseo_meta_data":{"post_id":"6297","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"Article","defaultPostTypeGraph":""},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"},\"blockGraphs\":[]}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2022-09-09 10:07:39","updated":"2025-06-08 02:00:06","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/\" title=\"Accueil\">Accueil<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/themespress.ca\/en\/categorie\/tutorials\/\" title=\"Tutorials\">Tutorials<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCrop \/ Resize images in WordPress templates\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Accueil","link":"https:\/\/themespress.ca\/en\/"},{"label":"Tutorials","link":"https:\/\/themespress.ca\/en\/categorie\/tutorials\/"},{"label":"Crop \/ Resize images in WordPress templates","link":"https:\/\/themespress.ca\/en\/crop-resize-images\/"}],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/6297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=6297"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/6297\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/4533"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=6297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=6297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=6297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}