What is better for wordpress performace?

_e() will translate the text passed as a argument to the language your site is currently set up to use (if the translation exists).

Anyway, don’t do that. Use it for text visible on the website, not for IDs/classes etc. To create context based css rules, simply add the WPML language ID as a body class:

add_filter('body_class', 'wpml_body_class');
function wpml_body_class($classes){
  return array_push($classes, ICL_LANGUAGE_CODE);
}

then style the elements you need to using something like:

.en .menu-top{
 ...
}

It’s faster, and you keep your code easy to maintain.

Leave a Comment

tech