{"id":229,"date":"2014-06-19T04:53:39","date_gmt":"2014-06-19T04:53:39","guid":{"rendered":"https:\/\/learnwebcode.com\/?p=229"},"modified":"2016-03-15T04:03:18","modified_gmt":"2016-03-15T04:03:18","slug":"wordpress-get_template_part-theme-development-tutorial","status":"publish","type":"post","link":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/","title":{"rendered":"WordPress get_template_part() &#8211; Theme Development Tutorial"},"content":{"rendered":"<div class=\"video-container\">\n<div class=\"video-container-inner\"><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/5WnhIMqPLoY\" frameborder=\"0\" allowfullscreen><\/iframe><\/div>\n<\/div>\n<p>In this lesson we learn how to use the &#8220;get_template_part()&#8221; function to avoid repeating nearly identical code throughout our various theme files. <\/p>\n<p>For example, posts are displayed very similarly on the blog homepage, the archives, and search results views, and &#8220;get_template_part()&#8221; is an excellent way to reuse a single chunk of code.<\/p>\n<p><a href=\"https:\/\/learnwebcode.com\/tutorial-files\/wp-theme-step-10.zip\">Link to download .zip of theme files as shown in this video<\/a> (note: this is not a &#8220;complete&#8221; WordPress theme yet and this download is only intended for educational purposes to dissect and review).<\/p>\n<p class=\"large-text\">Do you want to share the WordPress website that you&#8217;ve been creating on your computer with the world? The next step is to use a web host to share your site with the world. <a href=\"https:\/\/learnwebcode.com\/web-hosting\/\">Learn about web hosts, my favorite one, and how to get a plan for only $5.78 per month<\/a>.<\/p>\n<p><a href=\"https:\/\/learnwebcode.com\/learn-wordpress\/\">View the entire &#8220;Learn WordPress&#8221; series<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this lesson we learn how to use the &#8220;get_template_part()&#8221; function to avoid repeating nearly identical code throughout our various theme files. For example, posts are displayed very similarly on the blog homepage, the archives, and search results views, and &#8220;get_template_part()&#8221; is an excellent way to reuse a single chunk of code. Link to download [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-229","post","type-post","status-publish","format-standard","hentry","category-wordpress-video-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WordPress get_template_part() - Theme Development Tutorial - LearnWebCode<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress get_template_part() - Theme Development Tutorial - LearnWebCode\" \/>\n<meta property=\"og:description\" content=\"In this lesson we learn how to use the &#8220;get_template_part()&#8221; function to avoid repeating nearly identical code throughout our various theme files. For example, posts are displayed very similarly on the blog homepage, the archives, and search results views, and &#8220;get_template_part()&#8221; is an excellent way to reuse a single chunk of code. Link to download [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"LearnWebCode\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-19T04:53:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-15T04:03:18+00:00\" \/>\n<meta name=\"author\" content=\"Brad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\"},\"author\":{\"name\":\"Brad\",\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"headline\":\"WordPress get_template_part() &#8211; Theme Development Tutorial\",\"datePublished\":\"2014-06-19T04:53:39+00:00\",\"dateModified\":\"2016-03-15T04:03:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\"},\"wordCount\":156,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"articleSection\":[\"WordPress Video Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\",\"url\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\",\"name\":\"WordPress get_template_part() - Theme Development Tutorial - LearnWebCode\",\"isPartOf\":{\"@id\":\"https:\/\/learnwebcode.com\/#website\"},\"datePublished\":\"2014-06-19T04:53:39+00:00\",\"dateModified\":\"2016-03-15T04:03:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learnwebcode.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress get_template_part() &#8211; Theme Development Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learnwebcode.com\/#website\",\"url\":\"https:\/\/learnwebcode.com\/\",\"name\":\"LearnWebCode\",\"description\":\"Become a Web Developer\",\"publisher\":{\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learnwebcode.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6\",\"name\":\"Brad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"url\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"contentUrl\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\",\"width\":400,\"height\":400,\"caption\":\"Brad\"},\"logo\":{\"@id\":\"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg\"},\"url\":\"https:\/\/learnwebcode.com\/author\/lwcadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress get_template_part() - Theme Development Tutorial - LearnWebCode","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:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"WordPress get_template_part() - Theme Development Tutorial - LearnWebCode","og_description":"In this lesson we learn how to use the &#8220;get_template_part()&#8221; function to avoid repeating nearly identical code throughout our various theme files. For example, posts are displayed very similarly on the blog homepage, the archives, and search results views, and &#8220;get_template_part()&#8221; is an excellent way to reuse a single chunk of code. Link to download [&hellip;]","og_url":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/","og_site_name":"LearnWebCode","article_published_time":"2014-06-19T04:53:39+00:00","article_modified_time":"2016-03-15T04:03:18+00:00","author":"Brad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Brad","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#article","isPartOf":{"@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/"},"author":{"name":"Brad","@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"headline":"WordPress get_template_part() &#8211; Theme Development Tutorial","datePublished":"2014-06-19T04:53:39+00:00","dateModified":"2016-03-15T04:03:18+00:00","mainEntityOfPage":{"@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/"},"wordCount":156,"commentCount":0,"publisher":{"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"articleSection":["WordPress Video Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/","url":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/","name":"WordPress get_template_part() - Theme Development Tutorial - LearnWebCode","isPartOf":{"@id":"https:\/\/learnwebcode.com\/#website"},"datePublished":"2014-06-19T04:53:39+00:00","dateModified":"2016-03-15T04:03:18+00:00","breadcrumb":{"@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learnwebcode.com\/wordpress-get_template_part-theme-development-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learnwebcode.com\/"},{"@type":"ListItem","position":2,"name":"WordPress get_template_part() &#8211; Theme Development Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/learnwebcode.com\/#website","url":"https:\/\/learnwebcode.com\/","name":"LearnWebCode","description":"Become a Web Developer","publisher":{"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learnwebcode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/learnwebcode.com\/#\/schema\/person\/db825ebc5a08e39b01de31771e4c7fe6","name":"Brad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","url":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","contentUrl":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg","width":400,"height":400,"caption":"Brad"},"logo":{"@id":"https:\/\/learnwebcode.com\/wp-content\/uploads\/0UWl0Tet_400x400.jpg"},"url":"https:\/\/learnwebcode.com\/author\/lwcadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":9,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":933,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/posts\/229\/revisions\/933"}],"wp:attachment":[{"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnwebcode.com\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}