How to translate month names in “Archives”

if the translation is only for the archive widget, a filter function might work (to be added to functions.php of the theme): add_filter(‘get_archives_link’, ‘translate_archive_month’); function translate_archive_month($list) { $patterns = array( ‘/January/’, ‘/February/’, ‘/March/’, ‘/April/’, ‘/May/’, ‘/June/’, ‘/July/’, ‘/August/’, ‘/September/’, ‘/October/’, ‘/November/’, ‘/December/’ ); $replacements = array( ‘jan’, ‘feb’, ‘mar’, ‘apr’, ‘may’, ‘jun’, ‘jul’, ‘aug’, ‘sep’, … Read more

Translation of plugin in MU-PLUGINS directory not working

You need to use another action when in a mu-plugins. add_action(‘muplugins_loaded’, ‘myplugin_muload_textdomain’); plugins_loaded action work only after active plugins and pluggable functions are loaded. mu-plugins are not regular plugins and will not be loaded like them. As you can see in the following link, mu-plugins are loaded before anything else. Actions Run During a Typical … Read more

Override parent theme translation on child theme

I think I found a solution, but before a little Premise load_theme_textdomain() and load_child_theme_textdomain() are basically equal, the only difference is the default path they use: they get the current language (using get_locale()) and add the relative .mo file to the path passed as argument; then they call load_textdomain() passing as argument both the textdomain … Read more

Dynamically redirect page based on URL?

Assuming you stick with add_rewrite_rule(), if language and title where set as meta data on the /en/ post, then you can simplify the search down to a simple WP_Meta_Query() for /:lang/:title/ and pull the actually ID of the translated post there. Translations for /en/best-restaurants-in-tokyo: “/it/migliori-ristoranti-a-tokyo” => 4016 “/fr/meilleurs-restaurants-à-tokyo” => 4017

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)