Theme files

BasePress knowledge base themes are easy to create as they don’t differ much from WordPress themes.

Below is the list of all necessary files that make up a theme. You should not remove or skip any of these files when you want to create custom knowledge base themes. You are free to add any extra files if your design requires it.

  • css folder
    • style.css
      This contains the main theme styles.
    • icons.css (deprecated. Icons are now managed with the new Icons Manager under Basepress menu)
      This contains the icon classes
  • icons folder (deprecated as above)
    This contains the icons fonts and a xml file listing the icons and where they will be used. More about icons later on.
  • template-parts folder. This folder contains the templates for the various pages content.
    • post-content.php
      This file renders the post content.
    • sections-content.php
      This file generates the content of a multi sections page. It should list all sections with their articles.
    • sections-content-boxed.php
      This file generates the content of a multi sections page in boxed style. It shouldn’t show the list of articles.
    • single-section-content.php
      This file generates the content of a single section page. It should list all articles of the current section.
    • table-of-content.php
      This files renders the table of content in the articles body.
    • adjacent-articles.php
      These files render the next and previous articles navigation.
  • products.php
    (BasePress was originally created as a Multi Product KB so this file remains called products.php for backward compatibility)
    This template is responsible for generating the Knowledge base entry page and is called by the ‘basepress’ shortcode. It should render at least the Knowledge Bases grid.
    Further content can be place in this file or directly in the Knowledge base page that contains the shortcode.
  • sections.php
    This is the main template file responsible to generate the Knowledge base sections pages in list style. It should render the main content of multi sections pages and call the ‘sections-content.php’ file.
  • sections-boxed.php
    This is the main template file responsible to generate the Knowledge base sections pages in a boxed style. It should render the main content of multi sections pages and call the ‘sections-content-boxed.php’ file.
  • single-section.php
    This is the main template file responsible to generate a single section page of the Knowledge base. It should render the main content of single section page and call the ‘single-section-content.php’ file.
  • full-width.php
    This template renders the post page without sidebar. It is a mandatory page template, this is the default template if no template has been selected for a post.
  • two-columns-left.php
    This template renders the post with a left sidebar. This template is optional.
  • two-columns-right.php
    This template renders the post with a right sidebar. This template is optional.
  • search.php
    This is the main template file responsible to generate the search results for the knowledge base. It should render the main loop for a search result.
  • global-search.php
    This is similar to the search template but used for global searches: searches that include all Knowledge Bases.
  • comments.php
    This is the template for the article’s comments.
  • restricted.php
    This is the template that renders an article with the restricted content notice. It is called every time someone as reached a restricted article.
  • functions.php
    Use this file to run any custom code just like the function.php file found in any WordPress theme.

Was this helpful?


Next Article

Theme functions