WooCommerce Get Post with Language Code WPML

Today, let’s talk about how to get a WooCommerce Post with Language Code using the WPML module. The illustration below covers every available language. The example below will get translated post id of the given language. However, you can make use of this code with the installed WPML module.

Below is an example:

$langCode = 'fr';
$postId = 20;

$post = icl_object_id($postId,'post',false,$langCode);

Search

Recent Blogs

Categories

Archives

Archives

Tags