Support » Plugin: Polylang » [Plugin: Polylang] Horizontal widgets

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Chouby

    (@chouby)

    Please read the documentation. I wrote how to do.

    Thanks. It works for me.
    Another question – how to make alt attributes for flag images?
    I don’t want to use language names.

    Plugin Author Chouby

    (@chouby)

    Unfortunately, there is currently no way to modify this outside the code. Maybe i will improve this in the future.

    To do that, you can edit the file include/base.php, go at the line 133:

    return isset($url) ? '<img src="'.esc_url($url).'" alt="'.esc_attr($lang->name).'" />' : '';

    and replace $lang->name by whatever you want.

    Of course your modifications will be overwritten by the next plugin update.

    Hope it helps!

    thx but i don’t know by what to replace $lang->name

    Plugin Author Chouby

    (@chouby)

    This guy does not use Polylang anymore…

    You can do the same however. Above the line 133, you can write something like:

    switch ($lang->slug) {
      case 'en': $title = 'your title in English';
        break;
      case 'es': $title = 'your title in Spanish';
        break;
      default:
        break;
    }

    and then replace the line 133 by:

    return isset($url) ? '<img src="'.esc_url($url).'" alt="'.esc_attr($lang->name).'" title="'.esc_attr($title).'" />' : '';

    IT WORKS!!! BIG THX 🙂

    Plugin Author Chouby

    (@chouby)

    In v0.7, I will add a filter to do this. It will not necessary to modify the plugin code anymore 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Polylang] Horizontal widgets’ is closed to new replies.