• Hello my new site using that code for footer:

    <div class="row">
    <div class="col-md-6">
        <!-- Footer logo --> 
        <div class="footer-item footer-logo">
            <a href="https://www.part-ing.si/"><img src="https://www.part-ing.si/wp-content/themes/monolit/assets/images/footer-logo.png" alt="footer logo" /></a>
            <p>PART IN?ENIRING  </p>
        </div>
        <!-- Footer logo end --> 
    </div>
    <!-- Footer info --> 
    <div class="col-md-2">
        <div class="footer-item">
            <h4 class="text-link">Call</h4>
            <ul>
                <li><a href="#">+7(111)123456789</a></li>
                <li><a href="#">+1(000)987654321</a></li>
            </ul>
        </div>
    </div>
    <!-- Footer info end--> 
    <!-- Footer info --> 
    <div class="col-md-2">
        <div class="footer-item">
            <h4 class="text-link">Write</h4>
            <ul>
                <li><a href="#">[email protected]</a></li>
                <li><a href="#">[email protected]</a></li>
            </ul>
        </div>
    </div>
    <!-- Footer info-->
    <!-- Footer info end--> 
    <div class="col-md-2">
        <div class="footer-item">
            <h4 class="text-link">Visit</h4>
            <ul>
                <li><span>USA 27TH BROOKLYN NY</span></li>
                <li> <a href="#" target="_blank" rel="noopener noreferrer">View on map</a></li>
            </ul>
        </div>
    </div>
    <!-- Footer info end--> 
    </div>
    <!-- Footer copyright -->
    <div class="row">
    <div class="col-md-6"></div>
    <div class="col-md-6">
        <div class="footer-wrap">
            <span class="copyright">  © Monolit 2016. All rights reserved.  
            </span>
            <span class="to-top">To Top</span>
        </div>
    </div>
    </div>
    <!-- Footer copyright end -->

    The problem is that the site will be multilingual. I want to write that code in all three languages but I don’t know write code for definite on what pages will show correct language. Is that possible?

    • This topic was modified 5 years, 6 months ago by bcworkz. Reason: code fixed

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tyler

    (@tylerthedude)

    Hi there,

    You can use plugins such as WPML to display different languages depending on the user’s preferred language, so this is an option and it’s probably the most efficient way of going about this situation. Alternatively, you can use PHP to write conditional statements that will output the footer content in a different language depending on the user’s preferred language, but this would be unnecessary as there are already plugins that do this.

    Thanks!
    Tyler

    Moderator bcworkz

    (@bcworkz)

    I agree with Tyler that a multi-lingual plugin would be a great option. As he said, you could use conditional statements. A switch/case structure is a good alternative to a sequence of if/elseif/else statements. If you go this route, your code needs to get the selected language from somewhere. Typically the language is part of the permalink structure, so WP would need to have a language tag added and rewrite rules defined so the tag is properly parsed. Then you can get the language as a WP query var.

    A lot easier but not as elegant is to pass the chosen language as an URL query string, for example my-awesome-blog.biz/hello-world/?lang=en. Then you can get the passed value from $_POST['lang'].

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Footer widget’ is closed to new replies.