Ready to get started?Download WordPress


add id “selected” based on URL to wordpress language switcher (1 post)

  1. alrobelller
    Posted 2 years ago #

    <?php if( is_front_page() || is_home() ) { ?>
    <div class="motto_info_wrapper">
        <div class="motto">
        <h1>Kirill Zolotarev</h1>
            <li id="<?php if ( $_SERVER['REQUEST_URI'] == '/' ) { echo "selected"; }?>"><a class="russian_lang" href="<?php bloginfo('url'); ?>" title="">RUSSIAN</a></li>
            <li> | </li>
            <li id="<?php if ( $_SERVER['REQUEST_URI'] == '/en' ) { echo "selected"; }?>"><a class="english_lang" href="<?php bloginfo('url'); ?>/en/" title="">ENGLISH</a></li>
        <div id="blob"></div>
    <?php } ?>

    Though it doesn't work here mysite

Topic Closed

This topic has been closed to new replies.

About this Topic