Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Prosenjit Barman 1 year, 10 months ago.

Assisted by: Prosenjit Barman.

Author Posts
September 21, 2023 at 1:37 pm #14439845

sachaC-4

I have use <?php do_action('wpml_add_language_selector'); ?> code in header file to display dropdown. Now i have custom design for dropdown. How to add class in WPMLs default twig template.

Like i want to created div structure like below

>>>>>>>>>

<div class="header-language dropdown">

<ul class="dropdown-content">


  • arabic
    AE
  • </div>

    September 22, 2023 at 7:12 am #14443843

    Prosenjit Barman
    WPML Supporter since 03/2023

    Languages: English (English )

    Timezone: Asia/Dhaka (GMT+06:00)

    Hello There,
    Thanks for contacting WPML Support.

    I understand what you're looking for. Since you want to implement a custom language switcher on your site, instead of modifying the default template, you can consider creating a custom language switcher by following the documentation below.

    - https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/
    - https://wpml.org/wpml-hook/wpml_language_switcher/

    If you want to add custom classes to the existing Twig template, you'll need some custom coding. Unfortunately, assisting with this custom coding is beyond the scope of our support and therefore, I may not be able to assist you much in this matter. I appreciate your understanding in this matter.

    But, if you want, you can hire a professional who specializes in customizing WPML and its functionalities. You will find someone from here: https://wpml.org/contractors/

    If there is anything else you need help with, let me know.

    Best regards,
    Prosenjit