Support » Plugins » polylang 404 page in 2 languages

  • Polylang works fine for me, but I would like to show the 404 page in the 2 languages I use for my site. Can this be done with polylang, or must I add something in 404.php to catch the language the visitor has chosen?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Out of the box, Polylang should load the 404 page in the right language (if your theme 404 page is localized). How Polylang chooses the language depends on the options you have chosen.

    Thread Starter elisabetha


    Thanks. However, in my theme Sonar there’s 1 php in English which always comes up, also when I’m visiting a Dutch page. When I try to create a page called 404 to link it to 404_dutch.php this won’t work.

    Thread Starter elisabetha


    I solved it like this in 404.php:

    <p><?php $taal=pll_current_language($value);?>

    <article id=”post-0″ class=”post error404 not-found”>
    <h1 class=”entry-title”>
    <?php if ($taal ==”nl”) {
    echo “Niet gevonden” ;}
    <?php if ($taal ==”en”) {
    echo “Not Found” ;}


    That’s a way. The most common way used by plugins and themes is:

    <article id="post-0" class="post error404 not-found">
    <h1 class="entry-title">
    <?php _e("Not Found", 'my_theme');

    And then translate a the theme with the .po / .mo files.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘polylang 404 page in 2 languages’ is closed to new replies.