Template Overrides
WB Member Wiki uses a template hierarchy that allows theme developers to customize the wiki’s frontend appearance without modifying the plugin directly.
How Template Loading Works
Section titled “How Template Loading Works”When rendering wiki pages, the plugin checks for templates in this order:
- Theme directory:
wp-content/themes/{your-theme}/wb-member-wiki/ - Plugin directory:
wp-content/plugins/wb-member-wiki/templates/
If a matching template exists in your theme, it takes priority over the plugin’s built-in template.
Available Templates
Section titled “Available Templates”Single Wiki Page
Section titled “Single Wiki Page”File: single-wiki-page.php
Renders an individual wiki page. The template receives the standard WordPress $post object with wiki-specific content that has already been processed through the content filters (wiki links parsed, TOC added).
Override path:
wp-content/themes/{your-theme}/wb-member-wiki/single-wiki-page.phpWiki Archive
Section titled “Wiki Archive”File: archive-wiki-page.php
Renders the wiki page archive listing. Displays all published wiki pages in the standard WordPress archive format.
Override path:
wp-content/themes/{your-theme}/wb-member-wiki/archive-wiki-page.phpDashboard Templates
Section titled “Dashboard Templates”The dashboard shortcode uses several templates for different views:
| Template | Purpose |
|---|---|
wiki-list.php |
Dashboard page listing |
wiki-edit.php |
Create/edit page form |
wiki-history.php |
Revision history view |
wiki-diff.php |
Revision comparison view |
wiki-search.php |
Search results |
wiki-contributions.php |
User contribution list |
Override path (example):
wp-content/themes/{your-theme}/wb-member-wiki/wiki-list.phpCreating a Template Override
Section titled “Creating a Template Override”Step 1: Create the Directory
Section titled “Step 1: Create the Directory”In your active theme, create a wb-member-wiki directory:
wp-content/themes/{your-theme}/wb-member-wiki/Step 2: Copy the Template
Section titled “Step 2: Copy the Template”Copy the template you want to customize from the plugin:
wp-content/plugins/wb-member-wiki/templates/single-wiki-page.phpto:
wp-content/themes/{your-theme}/wb-member-wiki/single-wiki-page.phpStep 3: Customize
Section titled “Step 3: Customize”Edit the copied template in your theme. Your customizations will be preserved across plugin updates.
Template Variables
Section titled “Template Variables”Single Page Template
Section titled “Single Page Template”The single wiki page template has access to:
$post- The wiki page post object (standard WP_Post)- All standard WordPress template tags (
the_title(),the_content(), etc.) - Wiki-specific content is already processed through filters before template loading
Edit Form Template
Section titled “Edit Form Template”The edit template receives:
$page_id- The page ID being edited (0 for new pages)- Access to wiki settings via
WBMW_Helpers::get_settings() - Permission checks via
wbmw_access()->can_edit()
History Template
Section titled “History Template”$page_id- The wiki page ID- Revision data via
WBMW_Revisions::get_revisions()
CSS Classes
Section titled “CSS Classes”The plugin uses consistent CSS class prefixes for styling:
Page Structure
Section titled “Page Structure”| Class | Element |
|---|---|
.wbmw-wiki-content |
Main wiki page content wrapper |
.wbmw-wiki-meta |
Page metadata section |
.wbmw-wiki-categories |
Category badges |
.wbmw-wiki-tags |
Tag badges |
Table of Contents
Section titled “Table of Contents”| Class | Element |
|---|---|
.wbmw-toc |
TOC container |
.wbmw-toc-header |
TOC header with title |
.wbmw-toc-toggle |
Show/hide toggle button |
.wbmw-toc-list |
Navigation list |
Wiki Links
Section titled “Wiki Links”| Class | Element |
|---|---|
.wbmw-wiki-link |
Link to existing wiki page |
.wbmw-wiki-link-new |
Link to non-existent wiki page |
Editor
Section titled “Editor”| Class | Element |
|---|---|
.wbmw-editor |
Editor container |
.wbmw-editor-toolbar |
Editor toolbar |
.wbmw-editor-publish |
Publish button area |
Messages
Section titled “Messages”| Class | Element |
|---|---|
.wbmw-login-required |
Login prompt message |
.wbmw-no-permission |
Permission denied message |
Enqueued Assets
Section titled “Enqueued Assets”The plugin enqueues these assets on wiki pages:
Styles
Section titled “Styles”wbmw-public- Main frontend stylesheet (public/css/wbmw-public.css)select2- Select2 dropdown styles (4.1.0)
Scripts
Section titled “Scripts”wbmw-public- Main frontend JavaScript (public/js/wbmw-public.js)select2- Select2 dropdown library (4.1.0)
Localized Script Data
Section titled “Localized Script Data”The wbmw_ajax JavaScript object is available on all wiki pages:
wbmw_ajax = { url: '/wp-admin/admin-ajax.php', nonce: 'security_nonce', autosave_interval: 30000, // milliseconds edit_lock_enabled: 'yes', i18n: { saving: 'Saving...', saved: 'Saved', error: 'Error saving. Please try again.', // ... additional i18n strings }}Best Practices
Section titled “Best Practices”- Copy, don’t create from scratch - Always start with the plugin’s template and modify it
- Keep template structure - Maintain the existing HTML structure to ensure JavaScript functionality works
- Test after plugin updates - When the plugin updates, compare your overrides with the new default templates
- Use child themes - Place overrides in a child theme to preserve them across parent theme updates
- Preserve CSS classes - Don’t remove
.wbmw-prefixed classes that JavaScript depends on for functionality

