Templates are in the templates/ directory. They load the active theme's header.php and footer.php using get_header() / get_footer().
URL Routing
| URL Pattern | Template |
|---|---|
/forum/ | templates/forum-index.php (via page template of-forum-index.php) |
/forum/{room-slug}/ | templates/room-page.php (via of_room rewrite var) |
/forum/thread/{thread-slug}/ | templates/thread-page.php (via is_singular('of_thread')) |
/forum/profile/{username}/ | templates/profile-page.php (via of_profile rewrite var) |
Overriding templates
Copy template files into your theme at your-theme/oforum/ and they'll be loaded instead. (Note: template override detection to be added in v1.1.0; for now, child-theme CSS overrides are the recommended approach.)
Frontend JS globals
The OF global object is available on all forum pages:
javascriptwindow.OF = {
ajaxUrl: 'https://site.com/wp-admin/admin-ajax.php',
restUrl: 'https://site.com/wp-json/oforum/v1/',
nonce: '...', // WP REST nonce
ajaxNonce: '...', // AJAX nonce
loggedIn: 1, // 1 or 0
userId: 42,
loginUrl: '...',
forumUrl: '/forum/',
perPage: 25,
};
window.OF_emojis = ['👍', '❤️', '😂', '🔥', '💡']; // configured in settings
