MemberPress default pages, emails, courses, and other addon-related pages have default designs. Each design is located in a separate template file in the MemberPress plugin files. To modify or replace these designs with your custom ones, you must override MemberPress template files.
This document explains how to override MemberPress template files and where to find the templates you need.
Override MemberPress Template Files
Before creating any custom template files, you must create a directory in your child theme folder named “memberpress“. In this folder, you should place all your custom template files related to MemberPress and MemberPress add-ons.
To create the folder structure for the custom templates folder, follow these steps:
- Access your website files through an Client FTP (par exemple Filezilla) ou un gestionnaire de fichiers (par exemple Gestionnaire de fichiers). Si elle est disponible, vous pouvez également utiliser la fonction gestionnaire de fichiers fourni par votre hébergeur service.
- Naviguez jusqu'à /wp-content/themes/ dossier.
- Find and access the folder of your child theme.
- Add the folder named memberpress to this folder.
Accordingly, your folder path should be /wp-content/themes/your-child-theme/memberpress/ path. The your-child-theme part in the mentioned folder structure needs to match the name of your child theme folder.
Overridden Template File Location Examples
Modèle | Emplacement du fichier MemberPress | Emplacement d'un gabarit de surcharge |
Page d'inscription | plugins/memberpress/app/views/checkout/form.php | themes/your-child-theme/memberpress/checkout/form.php |
Onglet Accueil du compte | plugins/memberpress/app/views/account/home.php | themes/your-child-theme/memberpress/account/home.php |
Mot de passe défini par l'utilisateur Courriel | plugins/memberpress/app/views/emails/user_set_password.php | themes/your-child-theme/memberpress/emails/user_set_password.php |
Creating Custom Template Files
You can find all MemberPress template files in the /wp-content/plugins/memberpress/app/views/ dossier. To modify any template file, copy the default template file from this folder to the custom templates folder.
You should do this only for the template files you need to modify.
To override MemberPress template files, custom template file names must match the default file name.
In addition, when adding a template file, you must keep the directory structure after the /views folder intact.
For example, the MemberPress account home page template file (home.php) is located in the /wp-content/plugins/memberpress/app/views/account/ folder. Here, you will notice that the additional compte folder is present. C'est pourquoi, the path for the custom MemberPress account home page template file must be /wp-content/themes/your-child-theme/memberpress/account/home.php.
Adding the template files to your child theme this way will automatically override MemberPress template files. Now, you can apply all modifications to the file you copied.
Most Commonly Used MemberPress Template Files
As previously mentioned, MemberPress templates are located in the /wp-content/plugins/memberpress/app/views/ dossier.
Further below, you can find the path for each of the most commonly used MemberPress template files:
- Registration page: the form.php file under the checkout folder (/checkout/form.php)
- Checkout page: les payment_form.php file under the checkout folder (/checkout/payment_form.php)
- Paiement sur une seule page: the spc_form.php file under the checkout folder (/checkout/spc_form.php).
- Page du compte: all templates for MemberPress account pages are located under the compte folder. The MemberPress account uses various templates to control various elements of it:
- Home tab: les home.php file (/account/home.php);
- Subscriptions tab: les home.php file (/account/subscriptions.php);
- Transactions tab: les payments.ph file (/account/payments.php);
- Account menu items: les nav.php file (/account/nav.php);
- Account page password reset page: les password.php file (/account/password.php).
- Page de connexion: the form.php file under the connexion folder (/login/form.php).
- Password reset page of the Login page: les forgot_password.php file under the connexion folder (/login/forgot_password.php)
- ReadyLaunch Templates: If you enabled ReadyLaunch pages, these designs have their own separate template files. All ReadyLaunch template files are located in the /readylaunch dossier.
When copying these files, remember to keep the mentioned folder structure. To illustrate, for the Registration page template, you must create the checkout folder under the /wp-content/plugins/memberpress/app/views/ folder. Then you can add the form.php file to it.
Override MemberPress Email Templates
MemberPress emails are located in the /emails/ folder. Please note that templates with the prefix admin_ are used for the emails sent to administrators. Templates with the prefix utilisateur sont celles qui sont envoyées aux utilisateurs.
Suppose you want to override one of the Email Templates in the Settings (Tableau de bord > MemberPress > Paramètres > Emails). In that case, after you add or update the template file in your theme folder, you should go to Tableau de bord > MemberPress > Paramètres > Emails et cliquez sur Reset Defaults to load the new template. For example, in the case of the user_receipt.php file, you would need to update in MemberPress Settings:
Override MemberPress Add-On Template Files
To override MemberPress template files related to add-ons, copy the add-on template files to the /wp-content/themes/your-child-theme/memberpress/ dossier.
The default template files for each MemberPress add-on are located in the add-on-specific folder, which contains the app/views/ folders. In this case, you must also keep the directory structure present after the /views folder intact.
Below, you can find examples of how to place the custom template files for different MemberPress add-ons properly.
Once you copy the template file to the proper folder, you can apply the modifications you need.
Factures PDF Add-on Template Files
The PDF Invoice template files are located /wp-content/plugins/memberpress-pdf-invoice/app/views/account/invoice folder. Here, you can find both Simple and Modern invoice templates:
- Simple PDF Invoice: the simple.php file (/account/invoice/simple.php);
- Moderne Facture PDF: the moderne.php file (/account/invoice/moderne.php);
Accordingly, they should be placed in /wp-content/themes/your-child-theme/memberpress/account/invoice/simple.php for the Simple template.
Similarly, for the Modern template, use the /wp-content/themes/your-child-theme/memberpress/account/invoice/modern.php path.
Corporate Accounts Add-on Template Files
Les MemberPress Comptes d'entreprise template files are located /wp-content/plugins/memberpress-corporate/app/views/ dossier.
In this case, you should only add the files in the following way:
Modèle | Emplacement du fichier MemberPress | Emplacement d'un gabarit de surcharge |
Page de gestion des sous-comptes | plugins/memberpress-corporate/app/views/mpca-manage-account-template.php | themes/your-child-theme/memberpress/mpca-manage-account-template.php |
Cours sur MemberPress Add-on Template Files
Les Cours sur MemberPress template files are located /wp-content/plugins/memberpress-courses/app/views/ dossier.
On the other hand, if you enable the ReadyLaunch™ Courses/Lessons template, these template files are located under /wp-content/plugins/memberpress-courses/app/views/classroom/ dossier.
In this case, you should only add the files in the following way:
Modèle | Emplacement du fichier MemberPress | Emplacement d'un gabarit de surcharge |
Signet du cours | plugins/memberpress-courses/app/views/courses/courses_bookmark.php | themes/your-child-theme/memberpress/courses/bookmark.php |
ReadyLaunch Course Header | plugins/memberpress-courses/app/views/classroom/courses_header.php | themes/your-child-theme/memberpress/classroom/courses_header.php |
Most Commonly Used Addon-Related Templates
MemberPress add-ons are separate plugins that need to be installed and activated on your website to use them with MemberPress. Accordingly, addon-related templates are located in different folders:
- Factures PDF: the simple.php OU moderne.php file under the /wp-content/plugins/memberpress-pdf-invoice/app/views/account/invoice folder;
- Comptes d'entreprise: separate files for sub-account and corporate account templates located under /wp-content/plugins/memberpress-corporate/app/views/ dossier :
- Manage Sub-accounts page: mpca-manage-account-template.php
- Corporate Accounts section on Edit profile page: mpca-edit-user-template.php
- ReadyLaunch™ Courses: MemberPress courses use multiple template files, all located under the /wp-content/plugins/memberpress-courses/app/views/ dossier :
- Courses tab on Account page: the courses_list.php file under the /account/courses_list.php folder;
- Cours page: the courses_archive_course.php file under the /classroom/courses_archive_course.php folder;
- Cours page: the courses_single_course.php file under the /classroom/courses_single_course.php folder;
- Barre latérale du cours: the courses_sidebar.php file under the /classroom/courses_sidebar.php folder;
- Lesson page: the courses_single_lesson.php file under the /classroom/courses_single_lesson.php folder;
- Certificats: the courses_certificate.php file under the /courses/courses_certificate.php dossier.
Override MemberPress Styles
If you need to change CSS, the best way to do that currently is to use a CSS manager plugin (e.g. Custom CSS Manager) to add your own custom styles. If you're having trouble with your styles overriding MemberPress, you may need to add an important déclaration à leur intention.