Step 1: Insert this function into the theme functions.php file
- Code: Select all
function lang_category_id($id){
if(function_exists('icl_object_id')) {
return icl_object_id($id,'category',true);
} else {
return $id;
}
}
Step 2: in the featured-content-gallery/gallery.php file, replace this:
- Code: Select all
query_posts('category_name=' . get_option('gallery-category') . '&showposts=' . get_option('gallery-items'));
with this:
- Code: Select all
$trans_cat = lang_category_id( get_cat_id( get_option( 'gallery-category' ) ) );
query_posts('cat=' . $trans_cat . '&showposts=' . get_option('gallery-items'));
What changed:
The fcg plugin was grabbing all posts from whatever you set as the 'gallery-category' by Name.
now, we take that gallery name, find the gallery ID, find the translated gallery ID (if there is one) and then grab all posts from that Category ID.
Hope this saves someone time figuring this out.
-SwitzerBaden









