WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] How to replace lang-item lang-item-5 menu-item classes with id (4 posts)

  1. Legendre
    Member
    Posted 1 year ago #

    Hi!
    Could someone give me a hint to correctly replace CSS classes added by Polylang with a custom ID handle (say, id=lang) in language switcher menu:
    <li class="lang-item lang-item-5 menu-item"><a hreflang="ru" href="http://example.com/russian/">Рус</a></li>
    to get
    <li id="lang"><a hreflang="ru" href="http://example.com/russian/">Рус</a></li>
    instead?

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

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    You can use the filter pll_the_languages to modify the whole output of the pll_the_languages function.

    However, maybe you don't need it. See similar answer to similar question : http://wordpress.org/support/topic/plugin-polylang-how-to-insert-flags-into-menu-in-custom-positions?replies=5#post-2800859

  3. Legendre
    Member
    Posted 1 year ago #

    Thank you for your timely and comprehensive reply, Chouby.

  4. Legendre
    Member
    Posted 1 year ago #

    Sorry, but have to re-open this question. My coder asked me to try to get one and clear reply: is there a way to use id instead of classes in this particular case, or not. If it does exist, how to do it without checking the source code?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic