1. Home
  2. Knowledge Base
  3. Customizations
  4. PHP Functions
  5. How to Fix an Unaligned Language Switcher on the Login Page

How to Fix an Unaligned Language Switcher on the Login Page

Introduction

When using WPML, the language switcher appears by default at the upper middle of the login or registration page. If a custom background is enabled on the login page, the switcher may be hidden behind it. You can fix this by adding a small custom code snippet to your theme. This guide explains how you can fix an unaligned language switcher on the login page.

Note: BuddyBoss does not provide a built-in setting for this. The steps below are a custom workaround.

Custom Workaround

Before proceeding, make sure you have a complete site backup.

  1. In your WordPress admin dashboard, go to Appearance > Theme Editor.
  2. Under Select theme to edit, choose your active theme (preferably BuddyBoss Child Theme), then click Select.
  3. From the Theme Files list, click Theme Functions (functions.php).
  4. Paste the following code just before the closing PHP tag (?>):
function custom_login_logo() {
    echo '<style type="text/css">
        .wpml-login-ls { text-align: right !important; margin-right: 34px !important; }
        .login form { margin-top: 0px !important; }
    </style>';
}
add_action('login_head', 'custom_login_logo');

add_action(‘login_head’, ‘custom_login_logo’);

  1. Click Update File to save your changes.

Note: Any modifications like this are considered custom work. Please review the BuddyBoss Support Policy for details.

Troubleshooting and FAQs

Q: The language switcher is still behind the background, what should I check?
A: Make sure the code is added to the active theme’s functions.php and clear any caches.

Q: Can I adjust the position further?
A: Yes, modify the margin-right or text-align values in the CSS within the code snippet.

Q: Will this affect other pages?
A: No, this change only applies to the login and registration pages.

Q: Can I revert this change easily?
A: Yes, remove the code from functions.php and save.

Q: Who can I contact for further assistance?
A: Check the BuddyBoss Support Policy or consult a developer.

Was this article helpful?

Related Articles

Subscribe to Our Newsletter

Stay In Touch

Subscribe to our Newsletter, and we’ll send you the latest news from BuddyBoss

  • This field is hidden when viewing the form
  • This field is for validation purposes and should be left unchanged.

To speak to our Agency consultant, fill in the form found at our Contact Page.

  • Get Started

    Enter your name and email address to get started with your project...

  • This field is for validation purposes and should be left unchanged.