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

Can I have two different theme for two different language?

A WordPress Multi-site can handle multiple languages with individual themes and plugins activ. It’s like having multiple sites, one for every language, within one Installation. Every Site can have it’s own design, set of activ plugins and users. Read troth Method No. 5 on this Page for Details and Plugins that can help: http://codex.wordpress.org/Multilingual_WordPress

Is it possible to temporarily override the language setting?

Add a locale filter add_filter(‘locale’, ‘locale_filter’); and in the filter return the locale of your choice, function locale_filter($locale) { return “whatever”; } however, this needs to be done in context, your mail sending trigger will need to know the target user and get the locale from there, not very easy, although doable.

Multilanguage site with two domains

I recently answered a very similar question. Instead of having 2 separate websites, it’s far easier to install a translation plugin. The plugin will basically add extra fields or tabs in edit mode. For example, if you are editing a page titled “Home”, you will have a field for the English page title and then … Read more

How to query the custom fields by language?

In qTranslate, there is this function that “dispatch” the language with the kind of string you have. Haven’t tested it yet, but you could do something like: $myString = get_post_meta( $post_id, ‘Functions’, true); echo qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($myMeta); This will display the right language on your post based on the current page’s language.

How to create custom post type like Page

You should have a look at the register_post_type page in the codex. Look at the hierarchical argument when registering your post type hierarchical (boolean) (optional) Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The ‘supports’ parameter should contain ‘page-attributes’ to show the parent select box on the editor page. Default: … Read more