Title: uskro's Replies | WordPress.org

---

# uskro

  [  ](https://wordpress.org/support/users/uskro/)

 *   [Profile](https://wordpress.org/support/users/uskro/)
 *   [Topics Started](https://wordpress.org/support/users/uskro/topics/)
 *   [Replies Created](https://wordpress.org/support/users/uskro/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/uskro/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/uskro/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/uskro/engagements/)
 *   [Favorites](https://wordpress.org/support/users/uskro/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Polylang] [How to] Search results landing page with custom header for each language](https://wordpress.org/support/topic/how-to-search-results-landing-page-with-custom-header-for-each-language/)
 *  Thread Starter [uskro](https://wordpress.org/support/users/uskro/)
 * (@uskro)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/how-to-search-results-landing-page-with-custom-header-for-each-language/#post-6286692)
 * Here to answer my own question, I used an answer from one of the creator’s discussions
   with another fellow that can be found [here](https://wordpress.org/support/topic/plugin-polylang-how-to-translateswitch-specific-contents-on-templates?replies=17),
   which could have saved me a lot of troublem with all those categories that I 
   had to manually index.
 * But, nevertheless, this is what I ended up with.
 * If you want to switch header/footer/sidebar or other elements between **2** languages,
   where you have the files header.php for your default language (let’s say English)
   and header-fr.php for your default language (let’s say French), use:
 *     ```
       <?php
       $currentlang = get_bloginfo('language');
       if($currentlang=="en-GB"): get_header();
       else: get_header('fr');
       endif;
       ?>
       ```
   
 * If you want to switch header/footer/sidebar or other elements between **3 or 
   more** languages, where you have the files header.php for your default language(
   let’s say English) and header-fr.php for your default language (let’s say French)
   and header-de.php for German/Deutsch, use:
 *     ```
       <?php
        $currentlang = get_bloginfo('language');
        if($currentlang=="en-GB"): get_header();
        elseif($currentlang=="fr-FR"): get_header('fr');
        else: get_header('de');
        endif;
       ?>
       ```
   
 * Feel free to add as many elseif lines as you need.
 * This can also work with other functions, like this:
 *     ```
       <?php
       $currentlang = get_bloginfo('language');
        if($currentlang=="en-GB"): _e ('We apologize, but we did not manage to match your query.');
        elseif($currentlang=="fr-FR"): _e ('Nous nous excusons, mais nous ne sommes pas parvenus pour correspondre à votre requête.');
        elseif($currentlang=="hu-HU"): _e ('Elnézést kérünk, de nem sikerült megfelelő lekérdezést.');
        elseif($currentlang=="de-DE"): _e ('Es tut uns leid, aber wir konnten nicht ihren vorstellungen entsprach.');
        else: _e ('Ne cerem scuze, nu am găsit nicio postare conform criteriilor selectate.');
        endif;
       ?>
       ```
   
 * Or it can work with plain text, like this:
 *     ```
       <p>
        <?php
         $currentlang = get_bloginfo('language');
         if($currentlang=="en-GB"): echo "This is<br/>text";
         elseif($currentlang=="fr-FR"): echo "Ceci est un<br/>texte";
         elseif($currentlang=="hu-HU"): echo "Ez a<br/>szöveg";
         elseif($currentlang=="de-DE"): echo "Dies ist<br/>text";
         else: echo "Acesta este<br/>text";
         endif;
        ?>
       </p>
       ```
   
 * Thanks so much for the plugin and help in the forums, I’ve translated the plugin
   to Romanian as well, I just need to figure out where/how to send it to you. If
   I don’t find where, I’ll leave a download link here for a few days.
 * [polylang-ro_RO.mo](http://www.turismbarlad.ro/plt/polylang-ro_ro.mo)
    [polylang-ro_RO.po](http://www.turismbarlad.ro/plt/polylang-ro_ro.po)
 * Cheers!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to make current page parent hierarchy with links](https://wordpress.org/support/topic/how-to-make-current-page-parent-hierarchy-with-links/)
 *  Thread Starter [uskro](https://wordpress.org/support/users/uskro/)
 * (@uskro)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/how-to-make-current-page-parent-hierarchy-with-links/#post-5729339)
 * Thank you both, found what I was looking for in the Codex by searching for breadcrumbs.
   I’d rather not use plugins for this, and I’m fine with displaying just one category
   ^_^ Have a nice day, the both of you!

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