Use custom template on certain URLs

Thanks to @Milo on the comments, I’m gonna post my answer: Firstly I added this rule: add_rewrite_rule( “en/artist/([^/]+)/?”, ‘index.php?pagename=post_type=artist&artist=$matches[1]&gal_template=en’, “top”); Then this filter: add_filter( ‘query_vars’, ‘gal_query_vars’ ); function gal_query_vars( $query_vars ) { $query_vars[] = ‘gal_template’; return $query_vars; } Finally, I filtered the single template: add_filter( ‘single_template’, ‘get_custom_post_type_template’ ); function get_custom_post_type_template($single_template) { global $post; if ($post->post_type … Read more

How to set up WPLANG in wp-config.php for 4 languages?

I just found this which I applied and works perfectly: If you have your blogs installed in subdirectories you could use this solution: if (strpos($_SERVER[‘REQUEST_URI’], ‘/enblog’) === 0) { define (‘WPLANG’, ‘en_US’); } else { define (‘WPLANG’, ‘pl_PL’); } … and so on. Good luck!

How can I make a site viewable in multiple languages?

If your just looking for a way for your site to be viewed in other languages I would defiantly recommend using Google Translate Tools. I just add it to the theme: <div id=”google_translate_element”><span id=”trans”>Translate: </span></div> You can hide the Google Logo and funky colors in your css: .goog-logo-link{display:none;} Instead of calling the Google Translate js … Read more