WordBB Documentation
Note: This documentation is still a work-in-progress. More sections will be added to it soon.
Tip: The plugin’s readme.txt file contains a list of WordBB’s template functions, in the “Custom theme functions” section. You can find the same list on WordPress.org, too.
Documentation Index
Adapting Your Theme
If you use MyBB as your comment system (“Use MyBB as comment system” setting), then you should not use WordPress’s comment form anymore, as WordPress comments will be replaced by MyBB posts.
The solution is to hide the WP form if the current post is linked to a MyBB thread. You can check this using wordbb_get_thread_id(). Usually, you’ll most likely need to add some code in your theme’s comments.php file.
Here’s a pseudo-code example:
if(!wordbb_get_thread_id()) :
?>
<!- – no bridge thread, show WP’s comment form – ->
<?php else : ?>
<!- – show something like a "Discuss article on forums" link – ->
<!- – you can use wordbb_thread_link() to get the URL for the corresponding MyBB thread – ->
<?php endif ?>
You’ll also need to replace comments_popup_link with wordbb_comments_popup_link in your theme’s index.php file, so that if the current WP post in the loop is linked to a thread, WordBB will automatically display the correct number of posts in comment links. Also, if “Show MyBB posts as WP comments” is disabled, comment links will automatically point to corresponding MyBB threads. If there’s no linked thread, WordBB will fall back to the original comments_popup_link() behaviour.
MyBB global.php not found?
If you get an error complaining about the global.php file not being found, you have most likely entered a wrong path as your MyBB folder. Please note that it needs to be the absolute path.
You can get it by placing a PHP file in your MyBB directory containing the following code:
MyBB Cookie Path
If you have problems using the wordbb_get_userinfo() function work on WordPress, you need to modify your MyBB cookie’s path to “/” (assuming your WP is installed in your site’s root).
Recent Comments