WPML – 404 Error when I try to pass GET parameters in my “different languages in directories” installation

The problem your GET param is using the same name as the query var for your custom post type. $link = $link_aqui_se_sirve.’?’.$establecimientos_cpt_name.’=’.$tax->slug; With that URL, WordPress is expecting the value of the $establecimientos_cpt_name parameter to be a post slug. Instead you are giving it a taxonomy slug. This will give you a 404 unless you … Read more

How to set a dual language site in wordpress?

I can separate my answer to two sections Recommended: A bit about the translation plugins Nothing wrong if you use Polylang, WPML or QTranslate or other, those plugins are widely used and are for that purpose, also actively maintained. Also, those plguins support Arabic language very well. Switching posts Plugins like Polylang, WPML and other … Read more

language_attributes for two languages?

You can use a filter to modify the value before it is set function __language_attributes($lang){ // ignore the supplied argument $langs = array( ‘en-US’, ‘KO’, ‘JA’ ); // change to whatever you want $my_language = $langs[0]; // return the new attribute return ‘lang=”‘.$my_language.'”‘; } add_filter(‘language_attributes’, ‘__language_attributes’); Then just make sure your theme header has the … Read more

Can anybody provide me with a function to generate slugs?

This post provides a function, but it cannot handle non-latin characters. That’s because URLs can’t have non-latin/ASCII characters. Browsers might show non-latin characters to you, but it’s just a user interface feature. For example, if you visit this Wiktionary URL: https://en.wiktionary.org/wiki/わかもの#Japanese, you browser URL encodes the japanese characters to get the real URL: https://en.wiktionary.org/wiki/%E3%82%8F%E3%81%8B%E3%82%82%E3%81%AE#Japanese then … Read more