My question is very similar to this one. However, I can't add comments to get more explanation so I open a new question.
My website has no blog. The home page is a static page. But I want my category 22 to be the home page. i.e. when someone types domain.com I want them to arrive to domain.com/category/22/
The accepted answer in the question I found above, (from Chip Bennet) accomplishes what I need with this code:
function wpse121308_redirect_homepage() {
// Check for blog posts index
// NOT site front page,
// which would be is_front_page()
if ( is_front_page() ) {
wp_redirect( get_category_link( 22 ) );
exit();
}
}
add_action( 'template_redirect', 'wpse121308_redirect_homepage' );
However when this code is active in my functions.php, a user enters ANY URL to a page on a translated website, he is redirected to the English page each time. (I don't understand why that would happen but I tested it and it's really this code that does it).
My site uses this syntax for language sites: domain.com/de/
How can I change the code so that it will work also for multi-lingual sites?