Title: language tag declaration
Last modified: October 21, 2019

---

# language tag declaration

 *  [multidimentional](https://wordpress.org/support/users/multidimentional/)
 * (@multidimentional)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/language-tag-declaration/)
 * Hello again,
 * I use two languages on my website and I need to be able to change lang=””. So
   I have tried to override language_attributes(); using he following code
 * function __language_attributes () {
    if (is_page(array(6001,5924,5481,5443,5433,5341,5339,5328,1178,1177)))
   return ‘lang=”pl”‘; } add_filter (‘language_attributes’, ‘__language_attributes’);*/
 * It works just fine but then “lang=”” disappear completely on other pages.
 * I really appreciate any help with this one.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flanguage-tag-declaration%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/language-tag-declaration/#post-12051036)
 * Your code is not returning if it is not those pages, you need to return the string
   you are filtering even if you do not change it.
 * For example:
 *     ```
       function __language_attributes ( $string ) {
        if ( is_page(array(6001,5924,5481,5443,5433,5341,5339,5328,1178,1177))) {
          return 'lang="pl"';
        }
        return $string;
       }
       ```
   
 *  Thread Starter [multidimentional](https://wordpress.org/support/users/multidimentional/)
 * (@multidimentional)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/language-tag-declaration/#post-12051694)
 * Fantastic! Thank you very much.
 * I also noticed that right click does not work. Is it a “hidden” feature of the
   theme?
 * Not sure if I should start another thread.
 *  [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/language-tag-declaration/#post-12051707)
 * The theme does not remove right-click, that would have to be something else, 
   perhaps a plugin you have.
 * Ben

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

The topic ‘language tag declaration’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/virtue/3.4.14/screenshot.png)
 * Virtue
 * [Support Threads](https://wordpress.org/support/theme/virtue/)
 * [Active Topics](https://wordpress.org/support/theme/virtue/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/virtue/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/virtue/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/language-tag-declaration/#post-12051707)
 * Status: not resolved