{"id":368664,"date":"2025-10-24T08:35:51","date_gmt":"2025-10-24T02:35:51","guid":{"rendered":"https:\/\/directorist.com\/?post_type=docs&#038;p=368664"},"modified":"2025-10-24T08:35:56","modified_gmt":"2025-10-24T02:35:56","password":"","slug":"template-override","status":"publish","type":"docs","link":"https:\/\/directorist.com\/docs\/template-override\/","title":{"rendered":"Template Override"},"content":{"rendered":"\n<p>Template overriding refers to customizing a template file without making changes to the core file. Generally, when you make changes to the core file, a new plugin update overrides all of your changes. Directorist offers a robust templating system that allows you to override all the Directorist default template files without amending any of the plugin codes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Template Overriding Works<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Locate the plugin template:<\/strong> In the Directorist plugin folder, go to <code>wp-content\/plugins\/directorist\/templates<\/code>. Find the template file you want to change<a href=\"https:\/\/directorist.com\/documentation\/directorist\/developers-guide\/template-override\/#:~:text=How%20does%20it%20work%3F%20Simply%2C,along%20for%20a%20detailed%20guideline\">.<\/a> For example, the \u201cAbout\u201d section of the Author Profile page is at: <code>wp-content\/plugins\/directorist\/templates\/author\/about.ph<\/code><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"774\" src=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-94-1024x774.png\" alt=\"\" class=\"wp-image-368666\" srcset=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-94-1024x774.png 1024w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-94-300x227.png 300w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-94-768x580.png 768w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-94.png 1490w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Copy the file:<\/strong> Make a copy of this template file on your computer.<\/li>\n\n\n\n<li><strong>Create matching folders in your theme:<\/strong> In your active theme directory (e.g. <code>wp-content\/themes\/yourtheme<\/code>), create a new folder named <code>directorist<\/code>. Inside it, replicate any subfolders from the plugin\u2019s path. For the example above, you would create <code>directorist\/author<\/code> because the file was in <code>templates\/author<\/code>. <\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"629\" src=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95-1024x629.png\" alt=\"\" class=\"wp-image-368667\" srcset=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95-1024x629.png 1024w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95-300x184.png 300w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95-768x471.png 768w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95-1536x943.png 1536w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-95.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Paste the template into your theme:<\/strong> Place the copied file into the new theme folder. Following our example, paste <code>about.php<\/code> into: <code>wp-content\/themes\/yourtheme\/directorist\/author\/about.php<\/code> <\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"644\" src=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96-1024x644.png\" alt=\"\" class=\"wp-image-368668\" srcset=\"https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96-1024x644.png 1024w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96-300x189.png 300w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96-768x483.png 768w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96-1536x965.png 1536w, https:\/\/directorist.com\/wp-content\/uploads\/2025\/10\/image-96.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Edit the theme copy:<\/strong> Now that the file is in your theme, you can safely edit it. WordPress will use this version instead of the plugin\u2019s default. Your changes are preserved even if the plugin updates (because you did not touch the original plugin file).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example: Author \u201cAbout\u201d Template<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Plugin template path:<\/strong> <code>wp-content\/plugins\/directorist\/templates\/author\/about.php<\/code><\/li>\n\n\n\n<li><strong>Theme override path:<\/strong> <code>wp-content\/themes\/yourtheme\/directorist\/author\/about.php<\/code><\/li>\n<\/ul>\n\n\n\n<p>These paths show that the theme file mirrors the plugin\u2019s path after the <code>directorist<\/code> folder.<\/p>\n\n\n\n<p>By following this structure, Directorist will load your custom template. In this example, once you paste <code>about.php<\/code> into your theme, you can modify the Author Profile \u201cAbout\u201d section without affecting core files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Safe from updates:<\/strong> Your custom template file in the theme won\u2019t be overwritten by Directorist updates. You own that file in your theme.<\/li>\n\n\n\n<li><strong>Keep templates in sync:<\/strong> The plugin may introduce new features or changes in its default templates over time. When Directorist updates a template, you should copy the updated file from the plugin into your theme and merge your custom code into it. Always keep a backup of your custom changes so you can reapply them after updating the template.<\/li>\n\n\n\n<li><strong>Testing:<\/strong> After overriding a template, test your site to ensure your changes display correctly and do not cause errors.<\/li>\n<\/ul>\n\n\n\n<p>By following these steps and best practices, you can confidently override Directorist templates in a clean, update-safe way<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Template overriding refers to customizing a template file without making changes to the core file. Generally, when you make changes to the core file, a new plugin update overrides all of your changes. Directorist offers a robust templating system that allows you to override all the Directorist default template files without amending any of the [&hellip;]<\/p>\n","protected":false},"author":24585,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[699],"doc_tag":[],"class_list":["post-368664","docs","type-docs","status-publish","hentry","doc_category-developers-doc"],"year_month":"2026-03","word_count":434,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"yousuf.sovware","author_nicename":"yousuf-sovware","author_url":"https:\/\/directorist.com\/author\/yousuf-sovware\/"},"doc_category_info":[{"term_name":"Developers Doc","term_url":"https:\/\/directorist.com\/docs-category\/developers-doc\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs\/368664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/users\/24585"}],"replies":[{"embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/comments?post=368664"}],"version-history":[{"count":0,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/docs\/368664\/revisions"}],"wp:attachment":[{"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/media?parent=368664"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/doc_category?post=368664"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/directorist.com\/wp-json\/wp\/v2\/doc_tag?post=368664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}