Gengo, meta image plugin and Wordpress
First of all, I’m not sure why exactly Wordpress decided to change their database structure so that tags and categories are seen as one and the same database items (with some distinctions). I do know that it’s caused a great deal of stress with existing Wordpress users trying to upgrade to new versions and discovering that a lot of plugins just won’t work anymore. Recently I developed a Wordpress-based website with the language-plugin Gengo and the Meta Image plugin. Both great plugins, but not fully compatible with the new WP versions. The only solution I could think of is writing a few functions that call MySQL statements to actually get the post you’re looking for in the right language, and the right meta-image to go with that. It looks something like this:
$query=”SELECT DISTINCT posts.ID, posts.post_title, posts.post_content, posts.post_type, termrel.object_id, termrel.term_taxonomy_id, post2lang.post_id, post2lang.language_id, postmeta.post_id, postmeta.meta_key, postmeta.meta_value
FROM $wpdb->posts AS posts, $wpdb->term_relationships AS termrel, wp_post2lang AS post2lang, $wpdb->postmeta AS postmeta
WHERE termrel.term_taxonomy_id = ‘$cat’ AND termrel.object_id = posts.ID AND post2lang.post_id = posts.ID AND post2lang.language_id = ‘$language_ids’ AND posts.post_type = ‘post’ AND postmeta.post_id = posts.ID AND postmeta.meta_key = ‘prepic’
ORDER BY post_date DESC LIMIT $postlimit “;
As you might have noticed, I used wp_post2lang instead of $wpdb->post2lang since somehow it produces weird errors otherwise. Anyway, hope this is helpful for anyone facing the same problems. Let me know if you’ve found other solutions (besides waiting for all plugins to upgrade).