Override templates in theme

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

GD bbPress Toolbox uses several templates that can be replaced with the template from the theme. With this, you can make changes to default templates plugin adds, and if needed you can make layout changes to match your theme beyond simpler CSS changes.

There are many templates that can be copied over to the theme. If you copy any of these files to your theme, the plugin will first attempt to load files from the theme folder, and if they are not found there, the plugin will load default templates.

List of Templates

Templates are located in plugins folder templates/default.

Main templates

These are in the bbpress sub-folder.

  • gdbbx-dashboard-activity-post.php: used to display a single post in the admin dashboard activity widget.
  • gdbbx-form-attachment-edit.php: used to display a list of attachments when topic/reply is in edit mode.
  • gdbbx-form-attachment.php: used to display attachments upload form element inside theme or reply form.
  • gdbbx-form-lock.php: used to replace reply form when the topic is locked.
  • gdbbx-form-notify-on-reply-edit.php: used to show checkboxes in the reply edit form for notifications on edit.
  • gdbbx-form-notify-on-topic-edit.php: used to show checkboxes in the topic edit form for notifications on edit.
  • gdbbx-form-reply-locked.php: used to replace reply form when the forum topic replies are locked by the plugin.
  • gdbbx-form-report-post.php: used to display form for reporting topics and replies.
  • gdbbx-form-signature-bbpress.php: used to display signature edit form element inside bbPress profile edit form.
  • gdbbx-form-signature-generic.php: used to display signature edit form element using generic integration function.
  • gdbbx-form-topic-locked.php: used to replace topic form when the forum topics are locked by the plugin.
  • gdbbx-forums-statistics.php: used to display statistics block for the forums index.
  • gdbbx-forums-welcome.php: used to display welcome block for the forums index.
  • gdbbx-list-canned-replies.php: used to display canned replies block in the reply form.
  • gdbbx-search-form-block.php: additional search block to embed anywhere.
  • gdbbx-single-canned-reply.php: used to display single canned reply inside the canned replies block.
  • gdbbx-thanks-list.php: used to display the list of topic/reply thanks.
  • gdbbx-thanks-none.php: used to display thanks list when there are no thanks for topic/reply.
  • gdbbx-user-profile-protected.php: information to show when the user profile is hidden

Widgets templates

These are in the widgets sub-folder.

  • gdbbx-widget-foruminfo.php: used to display the Forum Information widget.
  • gdbbx-widget-foruminfo-list.php: used to display the Forum Information widget.
  • gdbbx-widget-newposts.php: used to show individual posts for New Posts widget.
  • gdbbx-widget-onlineusers.php: used to display the list of online users for the Online Users widget.
  • gdbbx-widget-search.php: used by the enhanced Search widget.
  • gdbbx-widget-statistics-list.php: used to display statistical information for Statistics widget.
  • gdbbx-widget-topicinfo.php: used to display Topic Information widget.
  • gdbbx-widget-topicinfo-list.php: used to display Topic Information widget.
  • gdbbx-widget-userprofile.php: used to display User Profile widget.
  • gdbbx-widget-userprofile-enhanced.php: used to display User Profile widget.

Modifications

To start making modifications, copy any or all of these files into your theme folder. But, to comply with bbPress standards, you can copy these files into a theme folder, or subfolders: bbpress or forums. So, if your theme is called ‘twentytwelve’, these are three potential locations where you can copy these files:

  • wp-content/themes/twentytwelve/
  • wp-content/themes/twentytwelve/bbpress/
  • wp-content/themes/twentytwelve/forums/

When you start editing copies of plugin templates make sure you don’t mess with INPUT, TEXTAREA, SELECT tags names or filter/actions functions because they are essential for plugin use.

Notices

  • Plugin version 5.0 changes the structure of the templates folder to mimic the structure of the bbPress template.
  • Plugin version 3.3 adds changes to the form elements layout, and if you have customized the gdbbx-form-attachment.php file, you need to update your file to use the same new layout for the form elements.
0
0
857
Rate this article

You are not allowed to rate this post.

2 thoughts on “Override templates in theme”

  1. I didn’t notice any change after doing this.
    Do I need to see a different article?
    I’m trying to get the additions to my forum to look the same as my theme.
    Text color and background color.
    clanthk.com is my site.

Leave a Comment