Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter W00tgnome

    (@w00tgnome)

    Ah, I did overlook something. It’ll suffice, just need to let my users know it’s there.

    Thread Starter W00tgnome

    (@w00tgnome)

    Yes, I think that would suffice.

    How does this work with Polylang? I take it instaling WPML is a neccessity?

    Thread Starter W00tgnome

    (@w00tgnome)

    Basically change:

    <ul class="language">
      <li class='lang-item lang-item-4 current-lang'>
        <a hreflang='en' href='/en/'>English</a>
      </li>
      <li class='lang-item lang-item-5'>
        <a hreflang='da' href='/da/'>Dansk</a>
      </li>
      <li class='lang-item lang-item-3'>
        <a hreflang='sv' href='/sv/'>Svenska</a>
      </li>
    </ul>

    To:

    <ul class="language">
      <li class="active">
        <a title="English" hreflang="en" class="en" href="/en/">English</a>
      </li>
      <li >
        <a title="Dansk" hreflang="da" class="da" href="/da/">Dansk</a>
      </li>
      <li >
        <a title="Svenska" hreflang="sv" class="sv" href="/sv/">Svenska</a>
      </li>
    </ul>

    In other words:
    – Replace single quotes with double quotes.
    – Apply class changes to <li> elements.
    – Apply class changes to <a> elements.
    – Add title attribute to <a> elements.

    I don’t know how much work there is in creating the possibility for a custom walker to be registered, but personally I’d be happy with just an array list of elements and their respective data, such as ISO-639-1 language code, translated language name and whether or not it is the current language (and I think this would also be faster to implement).

Viewing 3 replies - 1 through 3 (of 3 total)