Menú adicional

¡Consiga MemberPress hoy mismo! ¡Empieza a cobrar por los contenidos que creas! Obtenga MemberPress ahora
  1. Inicio
  2. Base de conocimientos
  3. Preguntas frecuentes
  4. Cómo
  5. How to Override MemberPress Template Files?

How to Override MemberPress Template Files?

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:

  1. Access your website files through an Cliente FTP (por ejemplo Filezilla) o un gestor de archivos (por ejemplo Gestor de archivos). Si está disponible, también puede utilizar la función gestor de archivos proporcionado por su alojamiento servicio.
  2. Vaya a /wp-content/themes/ carpeta.
  3. Find and access the folder of your child theme.
  4. 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.

Nota: The custom template files and the related folder structure need to be added to the child theme of your WordPress theme. If you edit files directly or add custom files to your active theme, all changes will be deleted with every update of the MemberPress plugin or the theme.

Overridden Template File Location Examples

PlantillaMemberPress Ubicación del archivoUbicación de la plantilla anulada
Página de inscripciónplugins/memberpress/app/views/checkout/form.phpthemes/your-child-theme/memberpress/checkout/form.php
Pestaña Inicio de cuentaplugins/memberpress/app/views/account/home.phpthemes/your-child-theme/memberpress/account/home.php
Usuario Establecer Contraseña Emailplugins/memberpress/app/views/emails/user_set_password.phpthemes/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/ carpeta. 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.

Consejo: You shouldn't copy the entire contents of the /wp-content/plugins/memberpress/app/views/ folder to the custom templates folder. Since templates change over time, copying only the files you need to modify will ensure that other (unmodified) templates are always up to date. This will limit the chance of conflicts with future upgrades to MemberPress.

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 cuenta folder is present. Por lo tanto, 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.

Nota: Templates can change over time. After each MemberPress update, you should check each custom template for any incompatibilities to ensure it continues to function correctly.

Most Commonly Used MemberPress Template Files

As previously mentioned, MemberPress templates are located in the /wp-content/plugins/memberpress/app/views/ carpeta.

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: el payment_form.php file under the checkout folder (/checkout/payment_form.php)
  • Pago en una sola página: the spc_form.php file under the checkout folder (/checkout/spc_form.php).
  • Página de la cuenta: all templates for MemberPress account pages are located under the cuenta folder. The MemberPress account uses various templates to control various elements of it:
    • Home tab: el home.php file (/account/home.php);
    • Subscriptions tab: el home.php file (/account/subscriptions.php);
    • Transactions tab: el payments.ph file (/account/payments.php);
    • Account menu items: el nav.php file (/account/nav.php);
    • Account page password reset page: el password.php file (/account/password.php).
  • Página de acceso: the form.php file under the inicio de sesión folder (/login/form.php).
  • Password reset page of the Login page: el forgot_password.php file under the inicio de sesión 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 /lanzamiento carpeta.

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 usuario_ son los que se envían a los usuarios.

Nota: The template files for only the emails listed under Panel de control > MemberPress > Configuración > Correos electrónicos can be found in the /emails/ carpeta.

Suppose you want to override one of the Email Templates in the Settings (Panel de control > MemberPress > Configuración > Correos electrónicos). In that case, after you add or update the template file in your theme folder, you should go to Panel de control > MemberPress > Configuración > Correos electrónicos y haga clic en 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/ carpeta.

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.

Facturas en 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);
  • Moderno Factura PDF: the moderno.php file (/account/invoice/moderno.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

En MemberPress Cuentas de empresa template files are located /wp-content/plugins/memberpress-corporate/app/views/ carpeta.

In this case, you should only add the files in the following way:

PlantillaMemberPress Ubicación del archivoUbicación de la plantilla anulada
Página de gestión de subcuentasplugins/memberpress-corporate/app/views/mpca-manage-account-template.phpthemes/your-child-theme/memberpress/mpca-manage-account-template.php

Cursos MemberPress Add-on Template Files

En Cursos MemberPress template files are located /wp-content/plugins/memberpress-courses/app/views/ carpeta.

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/ carpeta.

In this case, you should only add the files in the following way:

PlantillaMemberPress Ubicación del archivoUbicación de la plantilla anulada
Marcapáginas del cursoplugins/memberpress-courses/app/views/courses/courses_bookmark.phpthemes/your-child-theme/memberpress/courses/bookmark.php
ReadyLaunch Course Headerplugins/memberpress-courses/app/views/classroom/courses_header.phpthemes/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:

  • Facturas en PDF: the simple.php O moderno.php file under the /wp-content/plugins/memberpress-pdf-invoice/app/views/account/invoice folder;
  • Cuentas de empresa: separate files for sub-account and corporate account templates located under /wp-content/plugins/memberpress-corporate/app/views/ carpeta:
    • 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/ carpeta:
    • Courses tab on Account page: the courses_list.php file under the /account/courses_list.php folder;
    • Cursos page: the courses_archive_course.php file under the /classroom/courses_archive_course.php folder;
    • Curso page: the courses_single_course.php file under the /classroom/courses_single_course.php folder;
    • Barra lateral del curso: 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;
    • Certificados: the courses_certificate.php file under the /courses/courses_certificate.php carpeta.

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 declaración ante ellos.

¿Le ha resultado útil este artículo?

Artículos relacionados

chica del ordenador

¡Consiga MemberPress hoy mismo!

Empieza a cobrar por los contenidos que creas.