How to edit the membership 2 pro template regarding all pages under the account?

Hi, how are you?
I am working on the account page for membership2 pro which I have been able to have in my own template with boxed layout. The problem is when I click on the link " View invoices" it appeares in widescreen with no space on the sides. And alos when I click on "View activities" the same happends. It appears with no soace on the sides. I use boxed layout for the contents, and I would very much wish to edit these templates as well, so it all appear similar. Where can I find the templates to edit? The links I refer to is called: https://foreldrehjelp.no/account/?action=view_invoices
and https://foreldrehjelp.no/account/?action=view_activities
How can these and other pages under the accountwe part of my new account page template?

Thanks, kindly regards, Mathilde

  • Adam Czajczyk

    Hello Mathilde Oord

    I hope you're well today and thank you for your question!

    The Membership 2 Pro plugin can be customized using templates and for an "account" page you would want to create a template file in your theme folder, under a name of "m2-account.php".

    To start with, it's easiest to just copy a regular "page.php" template to the "m2-account.php" template and them customize the new one. Sine you're referring to templates in your post, I assume you have already created such template file, is that correct? Or did you do it in some different way?

    I'm asking because if that template exists, the Membership 2 Pro plugins should use it for an "account" page but also for it's "sub-pages", those being "Invoices" and "Activities" and also profile editing.

    Unfortunately, I can't see how it works on your site because account pages are available only to logged in users and I don't have access to them.

    That being said, please shed some more light on how did you exactly customize it (if possible, share the template files if any too - you can upload them to any file storage service like your Google Drive or Dropbox and share a link here). I would also like to take a closer look at these pages so would you mind enabling support access to the site for me?

    To do this, please go to the "WPMU DEV -> Support" page in your site's back-end and click on "Grant support access" button there, then let me know here when it's active.

    Looking forward to your reply,
    Adam

  • Mathilde Oord

    Hi Adam,
    Thanks a lot for you quick answer to me. I have opened the Grand support access.
    In this website I use the Enfold template. So since the account page is visable under "pages", I just put the short codes for the account in the layoutbuilder, so that it fits in the content, and that I can edit and add things to the page. I don't know if we somehow can dublicate this layout for the subpages for the account, or how we can do that? Is there any way to export a single page filewith the template to you?

    Thanks!
    Kindly regards, Mathilde

  • Adam Czajczyk

    Hi Mathilde Oord

    Thanks for granting support access.

    I checked the site and I think "duplicating layout" won't work here. I'm not much familiar with Enfold's code but it seems that it's just applying a default page template to any "virtual" page - the page that's dynamically generated.

    In other words, the "bare" account page that you customized is a physically existing page on your WordPress site and the layout is actually - that's oversimplification but it's "about" how it works - "part of content". When you're visiting any of "account" sub-pages (the "Invoices" or "Activities" page), that page is in fact dynamically generated so Enfold doesn't know about the layout that you saved. It takes default template because that's what it does when it doesn't know what template to use but that's where it stops.

    There are two ways to deal with that. One would be to follow the path that I explained in my previous post. You would need to create an actual page template. A custom page template (file name "m2-account.php") located in your theme folder (or, preferably, in a child theme folder) would be automatically fetched by the Membership 2 Pro plugin, essentially overwriting Enfold's behavior.

    That's a bit of customization and might involve some custom coding.

    Another option is to try to overcome this with just CSS. After taking a look at the structure and CSS of the "account" page I came out with this little CSS snippet

    .ms-member #wrap_all {
        background: #FFF;
    }
    .ms-account-wrapper {
        width: auto;
        margin: 10px auto;
        max-width: 1130px;
    }

    that, sort of, simulates the "boxed layout" that you are using there for all M2P "account" pages.

    I took a liberty of adding it to your site, via "Quick CSS" option on "Enfold -> General Styling" page (in case you wanted to adjust the code or remove it, you will find it there) and it seems to do the trick.

    As I'm not that familiar with your site as you are, please check the site and let me know if that works for you or if we need some other solution here :slight_smile:

    Best regards,
    Adam

  • Mathilde Oord

    Hi Adam,
    Thanks for the quick solution you provided me with the css codes. I think I'll go for the easiest way :slight_smile: I have copies the css over to my custum css under Apperance in admin, and also added for another site. Do you know how I can change the table border color to more light grey on these pages, and also how to make some space on the sides on mobile view?
    Thanks a lot!
    Kindly regards, Mathilde

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.