Overview
Attributes User Access uses a WordPress-style template system that lets you completely customize login form structure and layout. Override plugin templates in your theme for full control.
Understanding Template Hierarchy
How Templates Load
WordPress checks for templates in this order:
1. Active Theme Directory (Highest Priority)
/wp-content/themes/your-theme/attributes/front/
2. Child Theme Directory (If using child theme)
/wp-content/themes/your-child-theme/attributes/front/
3. Plugin Default Templates (Fallback)
/wp-content/plugins/attributes-user-access/templates/front/
Theme templates always override plugin templates. If no theme template exists, WordPress uses the plugin’s default template.
Available Template Files
Core Form Templates
| Template File | Purpose | Location |
|---|---|---|
login-form.php |
Main login form | templates/front/forms/ |
register-form.php |
Registration form (Pro) | templates/front/forms/ |
lost-password-form.php |
Password reset request | templates/front/forms/ |
reset-password-form.php |
New password entry | templates/front/forms/ |
two-factor-form.php |
2FA verification (Pro) | templates/front/forms/ |
Partial Templates
| Template File | Purpose | Location |
|---|---|---|
form-header.php |
Form header section | templates/front/partials/ |
form-footer.php |
Form footer section | templates/front/partials/ |
error-messages.php |
Error display formatting | templates/front/partials/ |
success-messages.php |
Success message display | templates/front/partials/ |
Creating Theme Template Overrides
Step-by-Step Process
Step 1: Create Directory Structure
In your theme, create this folder structure:
/wp-content/themes/your-theme/
attributes/
front/
forms/
partials/
Via FTP/File Manager:
- Navigate to your theme folder
- Create folder: attributes
- Inside attributes
, create:front
- Inside front
, create:formsandpartials
Via Terminal (if SSH access):
cd wp-content/themes/your-theme
mkdir -p attributes/front/forms
mkdir -p attributes/front/partials
Step 2: Copy Template File
Copy the template you want to customize:
From:
/wp-content/plugins/attributes-user-access/templates/front/forms/login-form.php
To:
/wp-content/themes/your-theme/attributes/front/forms/login-form.php
Step 3: Edit Your Template
- Open the copied file in a code editor
- Make your customizations
- Save the file
- Upload if editing remotely
Step 4: Clear Cache and Test
- Clear all caching:
- Browser cache (Ctrl+F5)
- WordPress cache plugins
- Server cache (if applicable)
- View your login page
- Verify changes appear
- Test form functionality thoroughly
Template Customization Examples
Example 1: Add Logo to Login Form
Edit: login-form.php
Add before form:
Add CSS:
.login-logo {
text-align: center;
margin-bottom: 30px;
}
.login-logo img {
max-width: 200px;
height: auto;
}
Example 2: Custom Field Labels
Edit: login-form.php
Find:
Change to:
And:
Change to:
Example 3: Add Help Text
Edit: login-form.php
After password field:
First time logging in? Check your email for temporary password.
CSS:
.login-help-text {
font-size: 13px;
color: #666;
font-style: italic;
margin-top: -10px;
margin-bottom: 15px;
}
Example 4: Social Login Buttons
Edit: login-form.php
After the main form:
Or login with
CSS:
.social-login-separator {
text-align: center;
margin: 30px 0 20px;
position: relative;
}
.social-login-separator:before {
content: "";
position: absolute;
top: 50%;
left: 0;
right: 0;
height: 1px;
background: #ddd;
z-index: 1;
}
.social-login-separator span {
background: white;
padding: 0 15px;
position: relative;
z-index: 2;
color: #666;
}
.social-login-buttons {
display: flex;
gap: 10px;
margin-top: 20px;
}
.social-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
padding: 12px;
border-radius: 4px;
text-decoration: none;
color: white;
font-weight: 500;
}
.google-btn {
background-color: #db4437;
}
.facebook-btn {
background-color: #4267B2;
}
Example 5: Two-Column Layout
Edit: login-form.php
Wrap form in columns:
Welcome Back
Login to access your dashboard and manage your account.
✓
Secure Access
✓
24/7 Support
✓
Member Benefits
CSS:
.login-page-container {
display: flex;
max-width: 1000px;
margin: 50px auto;
box-shadow: 0 2px 20px rgba(0,0,0,0.1);
border-radius: 8px;
overflow: hidden;
}
.login-left-column {
flex: 1;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 60px 40px;
}
.login-left-column h2 {
font-size: 32px;
margin-bottom: 20px;
}
.login-features {
margin-top: 40px;
}
.login-features .feature {
display: flex;
align-items: center;
gap: 15px;
margin-bottom: 20px;
font-size: 16px;
}
.login-features .icon {
font-size: 24px;
}
.login-right-column {
flex: 1;
background: white;
padding: 60px 40px;
}
@media (max-width: 768px) {
.login-page-container {
flex-direction: column;
}
}
Using PHP Hooks in Templates
Available Hooks
Before Login Form:
do_action('attrua_before_login_form');
After Login Form:
do_action('attrua_after_login_form');
Adding Custom Content via Hooks
In your theme's functions.php:
// Add welcome message before login form
add_action('attrua_before_login_form', 'my_custom_login_header');
function my_custom_login_header() {
?>
Welcome to
Please login to continue
Need help? Contact Support
}
Mobile Responsive Templates
Best Practices
1. Use Flexible Layouts:
.attributes-login-form {
max-width: 400px;
width: 100%;
padding: 20px;
}
2. Stack Columns on Mobile:
@media (max-width: 768px) {
.two-column-layout {
flex-direction: column;
}
}
3. Touch-Friendly Buttons:
.attributes-login-form input[type="submit"] {
padding: 15px; / Minimum 44px touch target /
font-size: 16px; / Prevents zoom on iOS /
}
4. Mobile Font Sizes:
@media (max-width: 768px) {
.attributes-login-form input {
font-size: 16px; / Prevents auto-zoom /
}
}
Testing Your Templates
- Visual test: Check appearance on login page
- Functional test: Submit form and verify login works
- Error test: Enter wrong password, check error display
- Mobile test: Test on phone and tablet
- Browser test: Check Chrome, Firefox, Safari, Edge
- Cache test: Clear all caches and retest
Troubleshooting
Template Changes Not Showing
- Clear browser cache (Ctrl+Shift+Del)
- Disable caching plugins temporarily
- Check file is in correct directory path
- Verify filename matches exactly (case-sensitive)
- Clear server cache (if applicable)
Form Broken After Customization
- Restore original template file
- Check for PHP syntax errors
- Verify all form fields remain intact
- Don't remove required hidden fields
- Check browser console for JavaScript errors
Template in Wrong Location
/themes/your-theme/attributes/front/forms/login-form.php
Not:
/themes/your-theme/attributes-login-form.php ❌
/themes/your-theme/templates/login-form.php ❌
Pro Tips
Always customize templates in a child theme to preserve changes during theme updates.
Before customizing, save a copy of the original template file as backup.
Track template changes in Git or similar version control for easy rollback.