wpForo v1 Documentation

  1. Home
  2. wpForo v1 Documentation
  3. Forum Themes
  4. Theme Files

Theme Files

wpForo themes are made up of template files. These are PHP files that contain a mixture of HTML, Template Tags, and PHP code. When you are building your custom forum theme, you will use template files to affect the layout and design of different parts of your forum. For example, you would use the header.php template to create a header, or the members.php template to load Members page.

When someone visits a page on your forum, wpForo loads a template based on the request. The server then parses the PHP in the template and returns HTML to the visitor.

wpForo themes are located in /wpforo/wpf-themes/ directory. At the moment there is only one theme (one folder) /classic/. Classic is the default wpForo theme. Below is a list of theme files recognized by wpForo.

Template files | wpforo/wpf-themes/classic/

Style CSS Files

  • style.css – main style-sheet
  • style-rtl.css – main style-sheet for RTL websites
  • widgets.css – widgets style-sheet
  • widgets-rtl.css – widgets style-sheet for RTL websites
  • colors.css – dynamic colors, these colors are set in Dashboard > Forums > Settings > Styles admin page. Also this file contains custom CSS code.

PHP Files

  • index.php – main template file, it wraps and loads all other template files based on visitor request.
  • header.php -the header template file usually contains your forum’s menu, breadcrumb and current view title (forum, topic, members, profile, etc…).
  • footer.php – for generating forum footer with forum statistic.
  • functions.php – theme specific functions, which adds features in forum front-end and options in forum settings. If you use wpForo hooks you should put functions and hook scripts in this file. If you use WordPress hooks you should use functions-wp.php file.
  • functions-wp.php – file is where you add unique features to your forum. It can be used to hook into the core functions of WordPress to make your theme more modular, extensible, and functional. If you use WordPress hooks you should use this file, if you use wpForo hooks you should use functions.php file.
  • login.php – forum login page template
  • register.php – user registering page template
  • members.php – member list template
  • profile.php – this template file is designed for user profile page. It contains profile pages’ header part and loads profile subPages. In other words profile.php is a wrapper for Profile home, account, activity and subscriptions subPages.
  • profile-home.php – profile Home sub-page template
  • profile-account.php – profile Account sub-page template
  • profile-activity.php – profile Activity sub-page template
  • profile-subscriptions.php – profile Subscriptions sub-page template
  • search.php – forum advanced search and search result template
  • 404.php – the 404 template is used when wpForo cannot find a content that matches the visitor’s request.

Layouts | wpforo/wpf-themes/classic/layouts/

Layouts are located in themes’ /layouts/ folder. In Classic theme’s /layouts/ folder you can find three layouts with separate folders:

Each layout contains files for forum, topic and post views:

  • forum.php – Forum list of a Category and subForum list of a Forum
  • topic.php – Topic list (forum page)
  • post.php – Post list (topic page)
  • etc..

Styles | wpforo/wpf-themes/classic/styles/

Styles are wpForo theme sub-components. This folder contains two PHP files:

  • colors.php – this file includes an array of different color styles to forum theme. For example Classic theme /styles/ folder adds six stiles with dozens of color options in each of them.
  • css.php – this is the CSS code matrix with colors’ variables. The dynamic colors.css file is being generated and updated based on css.php CSS code and colors.php color variables.

IMPORTANT: Please don’t use these two files for template style and color customization. These are theme core files and should not be changed. Style should be customized using style.css file. Colors should be customized in Dashboard > Forums > Settings > Styles admin page. The /classic/colors.css and /classic/styles/colors.php files are dynamic and should not be edited.