This thread is resolved. Here is a description of the problem and solution.
Problem:
I want to display sticky posts in a second language or fallback to the default language with a custom query.
Solution:
1. Go to WPML > Settings > Post Types Translation > Set Posts preference to "Translatable - use translation if available or fallback to default language:
2. Use the argument below for the custom query:
$test_ids = unserialize($wpdb->get_var( "SELECT `option_value`, `option_id` FROM `$wpdb->options` WHERE `option_name` = 'sticky_posts'" )); $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'post__in' => $test_ids, );
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 3 replies, has 2 voices.
Last updated by 1 year, 4 months ago.
Assisted by: Long Nguyen.