WordPress.org

Forums

how to tax_query the right way ? (1 post)

  1. anghelgabriel
    Member
    Posted 2 years ago #

    I have this code that should get all custom post's "testimonials" that are in a specific custom taxonomies "testimonial_categories".
    The problem is that the code works only when i am logged in as admin and it fails and shows all the testimonials when i log off and usign the website as simple user..

    What could be the issue here? Is there an error in my code ?

    <?php
                         $args = array(
    					 			'post_type' => 'testimonials',
                                    'tax_query' => array (
    									array (
    									'taxonomy' => 'testimonial_categories',
    									'field'	=> 'slug',
                                    	'terms' =>$testim_cats
    									)
    								),
    								'orderby' => 'date', 'order' => 'DESC'
    
                        );
                        $query = new WP_Query( $args );
                        ?>

Topic Closed

This topic has been closed to new replies.

About this Topic