{"id":982,"date":"2012-12-31T19:10:49","date_gmt":"2012-12-31T19:10:49","guid":{"rendered":"http:\/\/www.andrewhope.co.uk\/Blog\/?p=982"},"modified":"2022-05-14T19:15:36","modified_gmt":"2022-05-14T18:15:36","slug":"wordpress-custom-template","status":"publish","type":"post","link":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/","title":{"rendered":"DIY &#8211; Custom WordPress Template"},"content":{"rendered":"<p>There&#8217;s one thing that&#8217;s been bugging me since I created my site which I&#8217;m determined to resolve<\/p>\n<p>When I created this site, I wanted to have pages at the top of my screen which I could click on them in order to filter all posts in that category by their tag or &#8220;base&#8221; category<\/p>\n<p>This is proving rather difficult and annoying. So this will be my DIY attempt at resolving the problem<\/p>\n<p>I&#8217;m currently doing a dev version of this template in order to workaround this problem. I&#8217;ll be releasing the code if I get it working to help out others. I&#8217;ve tried different functions and plugins which should resolve this, but quite frankly they&#8217;re still confusing as shit to get working or they didn&#8217;t suit my needs<\/p>\n<p>I&#8217;ve tried wp-postviews and cat + tag filter amongst others<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s one thing that&#8217;s been bugging me since I created my site which I&#8217;m determined to resolve When I created [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":"","_links_to":"","_links_to_target":""},"categories":[4],"tags":[167,169,170,164,165,109,168,163,166,48],"class_list":["post-982","post","type-post","status-publish","format-standard","hentry","category-it","tag-categories","tag-custom-template","tag-diy","tag-filter-posts-by-category","tag-filter-posts-by-pages","tag-how-to","tag-pages","tag-pages-to-categories","tag-tags","tag-wordpress"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"There&#039;s one thing that&#039;s been bugging me since I created my site which I&#039;m determined to resolve When I created this site, I wanted to have pages at the top of my screen which I could click on them in order to filter all posts in that category by their tag or &quot;base&quot; category This\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"admin\"\/>\n\t<meta name=\"msvalidate.01\" content=\"95C2F67592576EDF87B6C4B9774D0014\" \/>\n\t<meta name=\"keywords\" content=\"categories,custom template,diy,filter posts by category,filter posts by pages,how-to,pages,pages to categories,tags,wordpress,it\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#article\",\"name\":\"DIY \\u2013 Custom WordPress Template | Andrew Hope\",\"headline\":\"DIY &#8211; Custom WordPress Template\",\"author\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"},\"datePublished\":\"2012-12-31T19:10:49+00:00\",\"dateModified\":\"2022-05-14T19:15:36+01:00\",\"inLanguage\":\"en-GB\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#webpage\"},\"articleSection\":\"IT, categories, custom template, diy, filter posts by category, filter posts by pages, how-to, pages, pages to categories, tags, wordpress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#listItem\",\"name\":\"DIY &#8211; Custom WordPress Template\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#listItem\",\"position\":3,\"name\":\"DIY &#8211; Custom WordPress Template\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/\",\"name\":\"admin\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#webpage\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/\",\"name\":\"DIY \\u2013 Custom WordPress Template | Andrew Hope\",\"description\":\"There's one thing that's been bugging me since I created my site which I'm determined to resolve When I created this site, I wanted to have pages at the top of my screen which I could click on them in order to filter all posts in that category by their tag or \\\"base\\\" category This\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/wordpress-custom-template\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2012-12-31T19:10:49+00:00\",\"dateModified\":\"2022-05-14T19:15:36+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#website\",\"url\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/\",\"name\":\"Andrew Hope\",\"description\":\"DIY, Gaming, Automotive Chat and Invention\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.andrewhope.co.uk\\\/Blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"DIY \u2013 Custom WordPress Template | Andrew Hope","description":"There's one thing that's been bugging me since I created my site which I'm determined to resolve When I created this site, I wanted to have pages at the top of my screen which I could click on them in order to filter all posts in that category by their tag or \"base\" category This","canonical_url":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/","robots":"max-image-preview:large","keywords":"categories,custom template,diy,filter posts by category,filter posts by pages,how-to,pages,pages to categories,tags,wordpress,it","webmasterTools":{"msvalidate.01":"95C2F67592576EDF87B6C4B9774D0014","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#article","name":"DIY \u2013 Custom WordPress Template | Andrew Hope","headline":"DIY &#8211; Custom WordPress Template","author":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"},"datePublished":"2012-12-31T19:10:49+00:00","dateModified":"2022-05-14T19:15:36+01:00","inLanguage":"en-GB","mainEntityOfPage":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#webpage"},"isPartOf":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#webpage"},"articleSection":"IT, categories, custom template, diy, filter posts by category, filter posts by pages, how-to, pages, pages to categories, tags, wordpress"},{"@type":"BreadcrumbList","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog#listItem","position":1,"name":"Home","item":"https:\/\/www.andrewhope.co.uk\/Blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#listItem","name":"DIY &#8211; Custom WordPress Template"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#listItem","position":3,"name":"DIY &#8211; Custom WordPress Template","previousItem":{"@type":"ListItem","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/#listItem","name":"IT"}}]},{"@type":"Person","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"},{"@type":"Person","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author","url":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/","name":"admin"},{"@type":"WebPage","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#webpage","url":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/","name":"DIY \u2013 Custom WordPress Template | Andrew Hope","description":"There's one thing that's been bugging me since I created my site which I'm determined to resolve When I created this site, I wanted to have pages at the top of my screen which I could click on them in order to filter all posts in that category by their tag or \"base\" category This","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/#breadcrumblist"},"author":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/author\/admin\/#author"},"datePublished":"2012-12-31T19:10:49+00:00","dateModified":"2022-05-14T19:15:36+01:00"},{"@type":"WebSite","@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#website","url":"https:\/\/www.andrewhope.co.uk\/Blog\/","name":"Andrew Hope","description":"DIY, Gaming, Automotive Chat and Invention","inLanguage":"en-GB","publisher":{"@id":"https:\/\/www.andrewhope.co.uk\/Blog\/#person"}}]}},"aioseo_meta_data":{"post_id":"982","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":[]},"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\"}}","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":"2020-12-21 13:50:36","updated":"2025-06-04 20:32:02","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.andrewhope.co.uk\/Blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/\" title=\"IT\">IT<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDIY \u2013 Custom WordPress Template\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.andrewhope.co.uk\/Blog"},{"label":"IT","link":"https:\/\/www.andrewhope.co.uk\/Blog\/category\/it\/"},{"label":"DIY &#8211; Custom WordPress Template","link":"https:\/\/www.andrewhope.co.uk\/Blog\/wordpress-custom-template\/"}],"views":91,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":0,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.andrewhope.co.uk\/Blog\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}