Title: error in PHP conditional
Last modified: September 29, 2024

---

# error in PHP conditional

 *  [sacconi](https://wordpress.org/support/users/sacconi/)
 * (@sacconi)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/error-in-php-conditional/)
 * I tryed to “redouble” the filter, not only for german, but also for english, 
   but it failed: [https://pastebin.com/BaK8TL1Y](https://pastebin.com/BaK8TL1Y)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-in-php-conditional%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/error-in-php-conditional/#post-18043790)
 * You’ve nested the `if` conditionals, that will not work in this situation. Instead
   use completely independent, un-nested conditionals without any `else` conditions.
 *     ```
        if ( 'de_DE' == get_locale() && ! empty( $german )){
            return $german;
        } 
        if ( 'en_EN' == get_locale() && ! empty( $english )){
            return $english;
        }
        // locale is not English or German to get to this point, it must be Italian
        return '<a href="https://test.sacconicase.com/contatti/">Contatti</a>'.'<br>'.'<a href="https://test.sacconicase.com/agenzia/">Agenzia</a>';
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘error in PHP conditional’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/error-in-php-conditional/#post-18043790)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
