I'll go on a guess that you are using the Demo Templates that are provided with User. In this case, {exp:user:register}
uses an error_page=""
parameter to display, on form submission, an error page based on a template set in the parameter. In the Demo Templates, it would be user_inc/error_template
(assuming you used user_
as your Demo Templates prefix). This template contains embeds for a header, sidebar, footer, etc. This gives you a well-formatted error page when submitting the registration form with errors.
When you visit the registration form as-is (i.e. no form submission yet), the error_page=""
is already triggered when "Allow New Member Registrations" is disabled, and the error page template content is pulled in and placed where your registration form would usually be. That means the error page's header, sidebar, footer embeds are also being added to the template, breaking the layout.
We'll make a note of this behaviour and see how we can improve this in the future, but you can get around that issue by adding conditionals in user_inc/error_template
to not display header, sidebar, footer code when the URL contains register
in it. Eg.
{if segment_2 != "register"}
// This will only display when on an error page
// i.e. on a page following a form submission
// eg. {embed="user_inc/index" page_title="{title}"}
{/if}
That way, if you view the registration form, header, sidebar, footer, etc code will not be pulled in form the error page template, but when you submit the form with errors, you'll have a formatted error page, with header, sidebar, footer, etc.