Dies ist das technische Support-Forum für WPML - das mehrsprachige WordPress-Plugin.

Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team beantwortet Anfragen im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.

Our next available supporter will start replying to tickets in about 4.76 hours from now. Thank you for your understanding.

Schlagwörter: 

This topic contains 3 Antworten, has 2 Teilnehmer.

Last updated by Diego Pereira vor 6 Monate, 2 Wochen.

Assigned support staff: Diego Pereira.

Author Artikel
März 27, 2019 um 3:49 pm #3473071

WP-Stars

Hi!
get_terms ordering is not working with wpml and the taxonomy 'category'.
It does not matter whether I order asc, desc or rand or by name, slug, id... the ordering stays the same:

	$categories = get_terms(array(
	'taxonomy' => 'category',
	'orderby'    => 'name',
        'order'      => 'asc',
        'hide_empty' => false
    ));
    

	foreach ($categories as $category) {
        echo $category->slug;
        echo '<br>';
	}

The Output would be, no matter what order parameters I use:

unkategorisiert
uncategorized
open-positions
press
press-en
open-positions-en
k-eigene
h-fahrschule
blog
b-healthcare
a-industrie
f-marketing
...

If I create a custom taxonomy, the ordering works as expected.
If I deactivate WPML, ordering with 'category' is also working as expected.

März 28, 2019 um 2:04 am #3476583

Diego Pereira
Supporter

Languages: Englisch (English ) Spanisch (Español ) Portugiesisch, Brasilien (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello @WP-Stars, welcome to the WPML support Forum!

I created a test website with a clean WordPress install + WPML. You can access it through this link:
hidden link - Through this link you will be automatically logged in.

Could you please reproduce the issue on this new install? This way we can isolate the issue to check if it's a bug and run some tests.

I also installed the WP File Manager plugin, which have a code editor in case you need to edit any file.

All the best,
Diego

März 28, 2019 um 7:47 am #3477711

WP-Stars

Hi!
Thank you!
I tried to reproduce the issue, but wasn't successfull.
What I forgot to mention is, that it is a multisite.

März 29, 2019 um 12:17 pm #3491153

Diego Pereira
Supporter

Languages: Englisch (English ) Spanisch (Español ) Portugiesisch, Brasilien (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

In this case I created a multi-site install here: hidden link

These are the credentials:
hello@wpml.org
Uv8249fJdX

Before trying to reproduce the issue on this clean multi-site install, please temporarily disable WPML on your website. With WPML disabled, the get_terms snippet works as expected or the issue persist?

Kind regards,
Diego

Das Thema ‘[Geschlossen] get_terms order paramteres ignored’ ist für neue Antworten geschlossen.