We have just released WPML 4.3.3. Before reporting issues please make sure to update - this version resolves all known issues with the major WPML 4.3 release

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Kim Gamez 6 months, 1 week ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
April 29, 2019 at 1:51 pm #3704045

Kim Gamez

I am trying to: see custom query on translated page

Link to a page where the issue can be seen: developing locally

I expected to see: the post results

Instead, I got: No results Found

April 29, 2019 at 1:56 pm #3704067

Kim Gamez

Displays in default language but not in translated language.

$post_id = get_the_id();
$args = array(
	'post_type' => 'vendor',
	'post_status' => 'publish',
	'post__not_in' => array( $post_id ),
	'posts_per_page' => $limit,
	'tax_query' => array(
        array(
            'taxonomy' => 'vendor_category',
            'field'    => 'term_id',
            'terms'    => wp_get_post_terms( $post_id, 'vendor_category', array( 'fields' => 'ids' ) ),
        ),
    ),
	'meta_query' => array(
        array(
            'key'     => 'subscription_level',
            'value'   => 3,
            'compare' => 'in',
        ),
    )
);

$query = new WP_Query($args);
April 30, 2019 at 4:40 am #3707857

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

You are using post_id on the query, which may not be returning the correct id on the translated language creating issues.

Could you please use the wpml_object_id hook to get the translated ID and let me know if this helps?
+ https://wpml.org/wpml-hook/wpml_object_id/
+ https://wpml.org/documentation/support/debugging-theme-compatibility/#issue-usage-of-the-wrong-id-value-for-the-wp_query-args-tax_query-field-arguments

Look forward to your reply.

Thanks

April 30, 2019 at 7:58 pm #3714703

Kim Gamez

Shekahar,
I am not sure exactly what I did but things seem to be working as I expect them to. weird

May 2, 2019 at 5:29 am #3721901

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Glad to know it worked, You can mark the ticket as resolved now.

Look forward to your reply.

Thanks

May 3, 2019 at 5:27 pm #3737271

Kim Gamez

My issue is resolved now. Thank you!