Skip to content

Templates

The addon ships its own templates for the single course page, the course reviews, and the BuddyPress group course screens. This page describes what each template is for and how it can be overridden.

Template Role
templates/single-course.php The Udemy-style single course page (tabs, teacher tab, review tab, features sidebar).
course-review/single-course-reviews.php The reviews wrapper: overview, review list, and review form. Loaded for the course post type through the comments_template filter.
course-review/review.php A single review row (fires the review row hooks).
course-review/review-meta.php The meta line inside a review.
course-review/reviews-overview.php The average rating and per-star breakdown.
templates/buddypress/groups/single/admin/edit-courses.php The group course-picker screen used on the group create, manage, and wp-admin settings screens.

The single course layout is chosen by the addon’s single_template / template_include filter. It first looks in your theme for a single-course.php file:

  1. wp-content/themes/<child-theme>/single-course.php
  2. wp-content/themes/<parent-theme>/single-course.php
  3. The addon’s templates/single-course.php

Copy single-course.php into your (child) theme root to override it.

The group screens resolve through the BuddyPress template stack. The addon registers its templates/ directory on the stack, so BuddyPress looks for a theme copy under your theme’s buddypress/ directory first, then falls back to the addon copy at templates/buddypress/groups/single/admin/edit-courses.php.

The addon includes two helper functions for custom code:

  • reign_sensei_get_template( $template_name, $args, $template_path, $default_path )
  • reign_sensei_locate_template( $template_name, $template_path, $default_path )

These resolve a template with a theme override under a sensei/ sub-directory (the same convention Sensei uses), fire reign_sensei_before_template_part / reign_sensei_after_template_part, and expose a reign_sensei_locate_template filter on the resolved path. They are available for your own template loading; the review templates listed above are included directly from the plugin folder and do not currently route through this sensei/ override path.

Review row customization without copying templates

Section titled “Review row customization without copying templates”

Each review row is assembled from action hooks (avatar, rating, title, meta, comment text). In most cases you can rearrange or extend a review by hooking those actions rather than copying review.php. See Hooks and filters.