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/themes/ directory. At the moment there is only one theme (one folder) /2022/. 2022 is the default wpForo theme. Below is a list of theme files recognized by wpForo.
Template files | wpforo/themes/2022/
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
- 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/themes/2022/layouts/
Layouts are located in themes’ /layouts/ folder. In 2022 theme’s /layouts/ folder you can find three layouts with separate folders:
- Extended Layout – #1 layout: wpforo/themes/2022/layouts/1/
- Simplified Layout – #2 layout: wpforo/themes/2022/layouts/2/
- Question & Answer Layout #3 layout: wpforo/themes/2022/layouts/3/
- Threaded Layout #4 layout: wpforo/themes/2022/layouts/4/
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)
Styles | wpforo/themes/2022/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 2022 theme /styles/ folder adds six stiles with dozens of color options in each of them.
- marix.css– this is the CSS code matrix with colors’ variables. The dynamic colors.css file is being generated and updated based on matrix.css 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 >Colors & Styles admin page.