I'm almost complete whit my wp theme an I'm now translating it with the WPML plugin. This is working out great (even all my custom post types and meta boxes :) ), but of course there have to be a problem. I have added meta boxes to one specific page and have target it like this:
add_action('admin_init','my_meta_init');
function my_meta_init()
{
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
// checks for post/page ID
if ($post_id == '17')
{
add_meta_box('meta_webdesign', 'Webdesign', 'my_meta_webdesign', 'page', 'normal', 'high');
add_meta_box('meta_grafisk', 'Grafisk design & Identitets design', 'my_meta_grafisk', 'page', 'normal', 'high');
add_meta_box('meta_illustrasjon', 'Illustrasjon', 'my_meta_illustrasjon', 'page', 'normal', 'high');
}
But now I need to also target the English version of the page (id 348), how do I do that?
Ps. I have tried this: if ($template_file == 'page-tjenester.php') (the Norwegian and English version both use the same template, but then all the meta boxes disappear.
I would be very grateful for help with this :)
$_GET, useget_query_var()instead, which provides sanitized data, even if it's for admin, I wouldn't depend on it. Have you tried addingelseif ($post_id == 348) { add_meta_box ... }? – soulseekah Oct 19 '11 at 10:03