Skip Navigation

[Gelöst] multiple tax_query

This support ticket is created vor 7 Jahre, 3 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 Antworten, has 2 Stimmen.

Last updated by Oniromancer vor 7 Jahre, 2 Monate.

Assigned support staff: Minesh.

Author
Artikel
#343949

I am trying to:
retrieve multiple taxonomies from Types cpts.

Im using this code

        $loop = new WP_Query(array (
            'post_type' 		=>	'custom_cpt',
            'posts_per_page' 	=> 	10, 
            'tax_query' => array(
                'relation' => 'OR',
                array(
                    'taxonomy' => 'first_tax',        
                    'field' => 'slug',                   
                    'terms' => array( 'term1' ),
                )
                array(
                    'taxonomy' => 'second_tax',               
                    'field' => 'slug',                   
                    'terms' => array( 'term2' ),
                )
            ),
        )); 

Why the code is not working?

thanks

#343987

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please tell me where exactly you are using this code? Can I have a link of the page where I can test this query results?

Also,
Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

To make sure that theme does not have any effect of query results, could you please try with default theme?

#344128

Hallo Minesh

> Could you please tell me where exactly you are using this code?
from inside a plugin.

the theme is the basic genesis, which is usually not interfering (it never did so far).

I can send you more informations over a provate post.

thank you

#344234

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please send me all relative information that should help me to investigate your issue further.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#344925

that was just a comma missing between the arrays.
thanks.