{"id":1214,"date":"2020-05-21T08:58:31","date_gmt":"2020-05-21T08:58:31","guid":{"rendered":"https:\/\/creativethemes.com\/blocksy\/?post_type=documentation&#038;p=1214"},"modified":"2024-01-09T17:12:20","modified_gmt":"2024-01-09T15:12:20","slug":"custom-post-types","status":"publish","type":"documentation","link":"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/custom-post-types\/","title":{"rendered":"Custom Post Types"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Quick Look<\/h3>\n\n\n\n<figure class=\"wp-block-video\"><video autoplay loop muted src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2020\/05\/Screen-Recording-2022-08-04-at-15.59.44.mov\"><\/video><figcaption class=\"wp-element-caption\">Custom CPT support in Blocksy&#8217;s Customiser<\/figcaption><\/figure>\n\n\n\n<p>By default, WordPress provides the &#8220;posts&#8221; post type. This is great, but some setups might require categorising posts differently. The Custom Post Types feature of WordPress comes into play here, letting you create your very own post type, in addition to the built-in ones to WordPress.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Creating your own CPT<\/h5>\n\n\n\n<p>Creating a new Custom Post Type can be achieved in a few ways &#8212;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>using a specialised plugin, such as CPT UI<\/li>\n\n\n\n<li><a href=\"https:\/\/developer.wordpress.org\/plugins\/post-types\/registering-custom-post-types\/\" data-type=\"URL\" data-id=\"https:\/\/developer.wordpress.org\/plugins\/post-types\/registering-custom-post-types\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">using PHP code<\/a><\/li>\n\n\n\n<li>using a plugin that automatically incorporates its own CPT<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">Handling CPTs in Blocksy<\/h5>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69ed135740b6c&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69ed135740b6c\" class=\"wp-block-image size-full has-lightbox wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2020\/05\/projects-cpt-archive-scaled.jpg\" alt=\"\" class=\"wp-image-5612\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Projects CPT archive detected inside the Customiser<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69ed1357422fe&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69ed1357422fe\" class=\"wp-block-image size-full has-lightbox wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2020\/05\/projects-cpt-single-scaled.jpg\" alt=\"\" class=\"wp-image-5613\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Projects CPT singular detected inside the Customiser<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>As you can see, Blocksy should automatically detect any properly implemented CPT and present the options for their archive pages, as well as singulars. These options are very similar to what the classic &#8220;posts&#8221; post type presents, and also inherits all of the features from that, such as support for custom fields from the <a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/post-types-extra\/\" data-type=\"URL\" data-id=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/post-types-extra\/\">Post Types Extra extension<\/a> and the ability to create personalised designs, using the template <a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/how-to-build-an-archive-template\/\" data-type=\"URL\" data-id=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/how-to-build-an-archive-template\/\">replacement<\/a> <a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/content-blocks-custom-single-templates\/\" data-type=\"URL\" data-id=\"https:\/\/creativethemes.com\/blocksy\/docs\/extensions\/content-blocks-custom-single-templates\/\">engine<\/a> that&#8217;s found in our Pro package.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">More Information<\/h5>\n\n\n\n<p>Of course, if you&#8217;re a Blocksy free user, you might want to check out the settings that are available in that version.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/blog-posts\/\"><img decoding=\"async\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2020\/05\/blog-posts.jpg\" alt=\"\" class=\"wp-image-5405\" \/><\/a><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/blog-posts\/\" data-type=\"URL\" data-id=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/blog-posts\/\">Blog Posts<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/single-posts\/\"><img decoding=\"async\" src=\"https:\/\/creativethemes.com\/blocksy\/wp-content\/uploads\/2020\/05\/single-post.jpg\" alt=\"\" class=\"wp-image-5467\" \/><\/a><figcaption class=\"wp-element-caption\"><a href=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/single-posts\/\" data-type=\"URL\" data-id=\"https:\/\/creativethemes.com\/blocksy\/docs\/post-types\/single-posts\/\">Single Post<\/a><\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Video Resources<\/h5>\n\n\n\n<p>If a video guide seems more handy to you, then check it out below! \ud83d\ude42<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Managing CPTs with Blocksy +@Meta Box  | Advanced Tutorial\" width=\"1290\" height=\"968\" src=\"https:\/\/www.youtube.com\/embed\/hpX57h1H2e4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Quick Look By default, WordPress provides the &#8220;posts&#8221; post type. This is great, but some setups might require categorising posts differently. The Custom Post Types feature of WordPress comes into play here, letting you create your very own post type, in addition to the built-in ones to WordPress. Creating your own CPT Creating a new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"doc_categories":[114],"class_list":["post-1214","documentation","type-documentation","status-publish","hentry","doc_categories-post-types"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"acf":[],"_links":{"self":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/types\/documentation"}],"author":[{"embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/comments?post=1214"}],"version-history":[{"count":1,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1214\/revisions"}],"predecessor-version":[{"id":9133,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/documentation\/1214\/revisions\/9133"}],"wp:attachment":[{"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/media?parent=1214"}],"wp:term":[{"taxonomy":"doc_categories","embeddable":true,"href":"https:\/\/creativethemes.com\/blocksy\/wp-json\/wp\/v2\/doc_categories?post=1214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}