Override templates in your theme

10 minAdvancedUltimate Membership Pro 14.2+

Ultimate Membership Pro builds its front-end (the Member Portal, the checkout, the login and registration forms and more) from PHP template files, and it looks for a copy of each one in your theme first. Put an edited copy in your theme and the plugin uses it, while plugin updates leave your copy untouched.

This guide explains how the plugin finds templates, then overrides one with a worked example.

Before you start

  • FTP, SSH or file manager access to your site, and basic PHP and HTML knowledge.
  • A child theme, so a theme update doesn’t remove your copies either.
  • Only the look needs to change? CSS is simpler; see Style forms and pages with CSS.

How the plugin finds a template

1. Your theme’s plugin folder

wp-content/themes/your-theme/ultimate-membership-pro/<file>.php. The recommended place.

2. Your theme’s root folder

wp-content/themes/your-theme/<file>.php. Also works, but mixes plugin files with the theme’s own.

3. The plugin

templates/public/ inside the plugin, used when the theme has no copy.

The plugin searches by file name only. Templates that sit in a subfolder of the plugin, such as checkout/checkout-subtotal.php or login-templates/ihc-login-template-11.php, go straight into your-theme/ultimate-membership-pro/ without the subfolder.

Templates you can override

Member Portal

account-page-header.php, account-page-tabs.php, account-page-overview.php, account-page-subscription-page.php, account-page-orders.php, account-page-help.php, account-page-custom-tab.php, account-page-footer.php and the other account-page-*.php files.

Checkout

checkout-main-page.php, checkout-payment-method.php, checkout-subtotal.php, checkout-taxes.php, checkout-purchase-button.php and the other checkout-*.php files.

Forms

Login templates (ihc-login-template-1.php to ihc-login-template-13.php), registration and profile form templates (form-template-1.php to form-template-14.php), change-password-form.php, login-popup.php, register-popup.php.

Tables and lists

subscription-table.php, orders-table.php, listing-levels.php, list-access-posts.php, membership-card.php, invoice.php.

Copy the template into your theme

  1. In the plugin folder, open templates/public/ and find the file, for example account-page-footer.php.
  2. Create the folder ultimate-membership-pro in your child theme.
  3. Copy the file into it, keeping the same file name.

Edit your copy

Change the HTML, keep the PHP that prints the data. Templates receive their values in the $data array.

your-theme/ultimate-membership-pro/account-page-footer.php (the end of the file)

<div class="ihc-user-page-footer">
    <?php if (!empty($data['content'])):?>
        <p><?php echo do_shortcode(stripslashes($data['content']));?></p>
    <?php endif;?>
    <p class="cc-portal-help"><?php esc_html_e( 'Need help with your membership? Write to support@coachingclub.example', 'coaching-club' ); ?></p>
</div>
Bottom of the Member Portal with the line Need help with your membership? Write to support@coachingclub.example outlined in orange
The Member Portal footer now uses the theme’s copy.

Good to know

  • The registration form and the profile form share the form-template-N.php files. Overriding one changes both.
  • Your copy doesn’t receive the plugin’s later changes to that template. After each plugin update, compare your copy with the new original and bring over what changed.
  • To go back to the plugin’s version, delete or rename your copy.

Tip

  • Copy only the templates you change. Every extra copy is one more file to keep in step with the plugin.

Example: a help line in the Member Portal

Coaching ClubMembers see where to get help at the bottom of every Member Portal tab.
Template
account-page-footer.php
Copied to
coaching-club-child/ultimate-membership-pro/
Change
One extra paragraph with the support address
Result
Shown under every Member Portal tab

Troubleshooting

Why does the plugin ignore my template copy?

Check the folder name (ultimate-membership-pro, inside the active theme or child theme) and that the file name matches the original exactly. Files from subfolders such as checkout/ go directly into that folder, without the subfolder. Clear the page cache too.

The page breaks after a plugin update. Why?

Your copy is based on an older version of the template. Compare it with the new file in templates/public/ and update it, or remove your copy to fall back to the plugin’s version.

Can I override the admin screens too?

No. Only the front-end templates in templates/public/ are looked up in the theme.

What’s next

What are your feelings

  • Happy
  • Normal
  • Sad

Stuck on something?

Full Package customers get Priority support from the team that builds Ultimate Membership Pro.

See the Full Package
Priority support

Get help faster with the Full Package

Full Package customers get Priority support, so their tickets are answered first by the team that builds Ultimate Membership Pro.

  • All 46 Pro add-ons and 3 extra payment gateways
  • Use it on up to 3 sites

Already on the Full Package? Open a priority ticket