Common changes with a few lines of code (Recipes)
Reign LifterLMS Addon overviewPremiumGet Reign LifterLMS Addon →
Also called: code snippets, functions.php recipes, child theme examples, customise courses with code, LifterLMS add-on hooks examples
Each recipe below makes one change that site owners often ask for. Copy the snippet, paste it into your child theme, and save. Every snippet was tested with Reign LifterLMS Add-on 2.7.0, Reign 8.1.0 and the official Reign child theme.
Before you start
Section titled “Before you start”- Install and activate the Reign child theme. Changes in the parent theme are lost when Reign updates.
- Open the child theme’s
functions.php. Paste each snippet at the very end of the file. - Edit files through your host’s file manager or SFTP. If a snippet has a typo, the site can show an error. You can then fix the file the same way.
Try each change on a staging copy first if your site is busy.
Show the Courses tab only to the member
Section titled “Show the Courses tab only to the member”Each member profile has a Courses tab. By default everyone who can see the profile sees it. This snippet shows the tab only to the member and to site admins.
add_filter( 'reign_llms_courses_tab_visible', function ( $visible, $profile_user_id, $viewer_id ) { if ( $viewer_id !== $profile_user_id && ! current_user_can( 'manage_options' ) ) { return false; } return $visible;}, 10, 3 );The filter hides the menu item and the page together, so nobody lands on an empty tab.
You’ll know it worked when a logged-out visitor opens a member profile and sees no Courses tab. The member still sees it on their own profile.
Use the Spotlight layout for one category
Section titled “Use the Spotlight layout for one category”The add-on has two course page layouts: Reign default and Spotlight. You pick one for the whole site in the Course page card. This snippet gives every course in the “Design” category the Spotlight layout.
add_filter( 'reign_llms_course_layout', function ( $layout, $course_id ) { if ( has_term( 'design', 'course_cat', $course_id ) ) { return 'spotlight'; } return $layout;}, 10, 2 );Change design to the slug of your course category. You find the slug on the category’s edit screen.
You’ll know it worked when a course in that category opens with the image behind the title. The page <body> then has the class rllms-course--spotlight.
Turn off reading mode
Section titled “Turn off reading mode”Lessons and quizzes show a Reading mode button. It puts the lesson in one readable column, with no site header or footer. This snippet removes the button and the mode everywhere.
add_filter( 'reign_llms_reader_enabled', '__return_false' );A student’s saved reading mode choice is then ignored. The Open lessons in reading mode setting only picks how a lesson opens, so it cannot remove the button by itself.
You’ll know it worked when a lesson page shows no Reading mode button.
Change one template: the separator on catalog cards
Section titled “Change one template: the separator on catalog cards”Each course card in the catalog has a line such as “5 lessons · 90 minutes · Beginner”. This override changes the dot between the parts to a bar. Use the same steps for any file in the add-on’s templates/ folder.
-
Copy
reign-lifterlms-addon/templates/loop/meta.php. -
Paste it into your child theme at
reign-child-theme/reign-lifterlms/loop/meta.php. Create thereign-lifterlmsandloopfolders if they are missing. -
In your copy, find this text.
<span class="rllms-card__sep" aria-hidden="true"> · </span> -
Change the dot to a bar.
<span class="rllms-card__sep" aria-hidden="true"> | </span> -
Save the file.
You’ll know it worked when the catalog cards read “5 lessons | 90 minutes | Beginner”.
Keep the @version line in your copy. After an add-on update, the Update status card lists your copy as out of date if the original changed. Then compare your copy with the new file. See Override a template and the Template reference for every file.
Good to know
Section titled “Good to know”My snippet broke the site. What do I do?
Section titled “My snippet broke the site. What do I do?”Open functions.php again through your host’s file manager or SFTP. Remove the snippet you just added and save. The site comes back straight away.
Can I use a code snippets plugin instead?
Section titled “Can I use a code snippets plugin instead?”Yes. The PHP snippets work the same in a snippets plugin. The template recipe needs the child theme, because it is a file.
Where do I find more hooks?
Section titled “Where do I find more hooks?”Every hook the add-on offers is in Hooks and filters.

