WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Horizontal widgets (9 posts)

  1. davidgabunia
    Member
    Posted 2 years ago #

    Hello here,

    So, I have vertical flags in my sidebar.
    How to make it horizontal?
    I think it needs css solution

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    Please read the documentation. I wrote how to do.

  3. davidgabunia
    Member
    Posted 2 years ago #

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

  4. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    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!

  5. davidgabunia
    Member
    Posted 2 years ago #

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

  6. davidgabunia
    Member
    Posted 2 years ago #

  7. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    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).'" />' : '';
  8. davidgabunia
    Member
    Posted 2 years ago #

    IT WORKS!!! BIG THX :)

  9. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags