<div class='ui dimmer modals page' style='display: none;'><div id='helpie-password-modal' class='pauple_helpie ui modal small' style='display: none;'><div class='ui header'><i class='circular lock icon'></i> Password Protected</div><div class='item-content'><br /><label for='password_check'>Enter Password : </label><p><input type='password' id='password_check' name='password_check' class='password' value='' required></p></div><div class='actions'><div class='ui black deny button'>Nope</div><div class='ui positive right labeled icon button'>Yep, that's right!<i class='checkmark icon'></i></div></div><div class='clear'></div></div></div>{"id":389,"date":"2017-09-07T05:25:35","date_gmt":"2017-09-07T05:25:35","guid":{"rendered":"https:\/\/helpiewp.com\/docs\/?post_type=pauple_helpie&#038;p=389"},"modified":"2020-01-20T15:02:12","modified_gmt":"2020-01-20T09:32:12","slug":"create-custom-templates-for-your-knowledge-base","status":"publish","type":"pauple_helpie","link":"https:\/\/helpiewp.com\/docs\/home\/create-custom-templates-for-your-knowledge-base\/","title":{"rendered":"Create Custom Templates for your KB"},"content":{"rendered":"<p>You can create custom templates to replace the Knowledge Base templates from Helpie WP plugin. There are current 4 main templates:<\/p>\n<h3><span id=\"helpie-sp-1\">1. Main Page Template :<\/span><\/h3>\n<p>This is the archive page template of Helpie\u2019s Custom Post Type. You can register a custom template for KB archive \/ main page by using the following code. You can use this code in your theme \/ child theme\u2019s functions.php<\/p>\n<pre class=\"language-php\"><span class=\"token keyword\">function<\/span> <span class=\"token function\">set_custom_helpie_mp_template<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$template<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token punctuation\">{<\/span>\r\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span> <span class=\"token function\">is_post_type_archive<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token string\">'pauple_helpie'<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n    <span class=\"token variable\">$template<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">get_stylesheet_directory<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token string\">'\/mainpage-helpie.php'<\/span><span class=\"token punctuation\">;\r\n<\/span>  }\r\n  return <span class=\"token variable\">$template;<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n\r\n<span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'template_include'<\/span><span class=\"token punctuation\">,<\/span><span class=\"token string\">'set_custom_helpie_mp_template'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/pre>\n<p>Here \u2018mainpage-helpie.php\u2019 is the name of the new template you are creating for the Main Page.<\/p>\n<h3><span id=\"helpie-sp-2\">2. Category Page Template :<\/span><\/h3>\n<p>This is the category page template of Helpie\u2019s Custom Post Type.<\/p>\n<pre class=\"language-php\"><span class=\"token keyword\">function<\/span> <span class=\"token function\">set_custom_helpie_cat_template<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$template<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token punctuation\">{<\/span>\r\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span> <span class=\"token function\">is_tax<\/span><span class=\"token punctuation\">(<\/span> <span class=\"token string\">'helpdesk_category'<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\r\n    <span class=\"token variable\">$template<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">get_stylesheet_directory<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token string\">'\/catpage-helpie.php'<\/span><span class=\"token punctuation\">;\r\n  }\r\n  return <span class=\"token variable\">$template;<\/span><\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'template_include'<\/span><span class=\"token punctuation\">,<\/span><span class=\"token string\">'set_custom_helpie_cat_template'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/pre>\n<p>Here \u2018catpage-helpie.php\u2019 is the name of the new template you are creating for the Category Page.<\/p>\n<h3><span id=\"helpie-sp-3\">3. Single Page Template:<\/span><\/h3>\n<p>This is the template used for the single article page in Helpie\u2019s Knowledge Base.<\/p>\n<pre class=\"language-php\"><span class=\"token keyword\">function<\/span> <span class=\"token function\">set_custom_helpie_single_template<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$template<\/span><span class=\"token punctuation\">)<\/span>\r\n<span class=\"token punctuation\">{<\/span>\r\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span> <span class=\"token function\">is_singular<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'pauple_helpie'<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">)<\/span> \r\n  <span class=\"token punctuation\">{<\/span> \r\n    <span class=\"token variable\">$template<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">get_stylesheet_directory<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token string\">'\/single-helpie.php'<\/span><span class=\"token punctuation\">;<\/span>   \r\n  <span class=\"token punctuation\">}<\/span>\r\n    <span class=\"token keyword\">return<\/span> <span class=\"token variable\">$template<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'template_include'<\/span><span class=\"token punctuation\">,<\/span><span class=\"token string\">'set_custom_helpie_single_template'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/pre>\n<p><code><br \/>\n<\/code><\/p>\n<p>This condition checks for single template of \u2018pauple_helpie\u2019 post type.<br \/>\nHere \u2018single-pauple.php\u2019 is the name of the new template you are creating for the Single Page.<\/p>\n<div class=\"heateor_sss_sharing_container heateor_sss_vertical_sharing heateor_sss_bottom_sharing\" style=\"width: 44px;\">\n<div class=\"heateorSssClear\"><\/div>\n<div class=\"heateorSssSharingArrow heateorSssPullOut\" style=\"float: left;\" title=\"Hide\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>You can create custom templates to replace the Knowledge Base templates from Helpie WP plugin. There are current 4 main templates: 1. Main Page Template : This is the archive page template of Helpie\u2019s Custom Post Type. You can register a custom template for KB archive \/ main page by using the following code. You &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/helpiewp.com\/docs\/home\/create-custom-templates-for-your-knowledge-base\/\"> <span class=\"screen-reader-text\">Create Custom Templates for your KB<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":292,"featured_media":402,"menu_order":45,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"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":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"helpdesk_category":[48],"helpie_tag":[21],"helpie_add_tag":[20],"helpie_up_tag":[],"class_list":["post-389","pauple_helpie","type-pauple_helpie","status-publish","format-standard","has-post-thumbnail","hentry","helpdesk_category-helpiekb","helpie_tag-templates","helpie_add_tag-new"],"_links":{"self":[{"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/pauple_helpie\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/pauple_helpie"}],"about":[{"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/types\/pauple_helpie"}],"author":[{"embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/users\/292"}],"replies":[{"embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":2,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/pauple_helpie\/389\/revisions"}],"predecessor-version":[{"id":1343,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/pauple_helpie\/389\/revisions\/1343"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/media\/402"}],"wp:attachment":[{"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"helpdesk_category","embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/helpdesk_category?post=389"},{"taxonomy":"helpie_tag","embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/helpie_tag?post=389"},{"taxonomy":"helpie_add_tag","embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/helpie_add_tag?post=389"},{"taxonomy":"helpie_up_tag","embeddable":true,"href":"https:\/\/helpiewp.com\/docs\/wp-json\/wp\/v2\/helpie_up_tag?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}