Simple Multilanguage Switcher

Assuming you’re talking about the front-end and you have your strings properly internationalized, you just need to insert the load_theme_textdomain() function to tell wordpress where are your .po files. this is how the Toolbox Theme does it: /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If … Read more

How to use language files in plugins?

Basically read the source for the function load_plugin_textdomain(): function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) Ignore the second parameter, it was deprecated a long time ago. An example from my plugin T5 Taxonomy Location: protected function load_language() { load_plugin_textdomain( ‘plugin_t5_tax_location’, FALSE, plugin_basename( dirname( __FILE__ ) ) . ‘/languages’ ); } The first … Read more

Locale switching with a “language” taxonomy

You might be interested in url_to_postid function Used as follows from your wpsx_redefine_locale function: $url = $_SERVER[‘REQUEST_URI’]; $postid = url_to_postid( $url ); Note that this does not return the post id for custom post types but the function is located in /wp-includes/rewrite.php and might be extended if needed. UPDATE: here’s your sample: function my_function(){ if … Read more

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