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 1 reply, has 2 voices.

Last updated by Itamar 10 months, 1 week ago.

Assigned support staff: Itamar.

Author Posts
August 31, 2019 at 10:16 am #4490603


I am trying to get all categories from back-end but I get an empty array on non-default language:

The default language shows the category menu below the main menu.

But I do not get anything in arabic language(non-default language)

Here is my code(no custom query works):

    $taxonomy = 'product_cat';
    $order_by = 'include';

      $args = array(
            'taxonomy'     => 'product_cat',
            'orderby'    => 'include',
            'hide_empty' => false,
            'include'    => array( 233, 169, 305, 212, 274, 308, 309, 310)
    //Both the get_categories and get_terms return empty array
    $all_categories_2 = get_categories($args);
    $all_categories = get_terms( $args );
        //testing a general query using wpdb
        function testing_wpdb_get_results() {
            global $wpdb;
            $results = $wpdb->get_results( 
                    $wpdb->prepare("SELECT * FROM `wp_comments`") 
September 1, 2019 at 11:16 am #4492435


Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)


It is essential for me to state that supporting custom code is out of the scope of this support forum. Please see our support policy here.

Nevertheless, we have extensive information for developers at the following link.
And we have API hooks which you can use here.
If something is not working for you with one of our hooks and you can show us what is not working, we'll investigate why it is happening and advice to you how to use it or fix it if from our side needed.

But otherwise, as I wrote here, debugging a custom theme is out of the scope of this forum.
At this point, I would suggest you consider contacting one of our certified partners from this link:
Before doing so please have a look also here:

With our contractors, you might get the custom assistance you need to get on with your project.

Best Regards,