Parse error: syntax error, unexpected ''tax_query'' in wordpress

hi i want to display posts by term. first the code display all the posts:

 $aProjectArgs = array(
            'post_type' = 'uni_project',
            'posts_per_page' = -1,
            'orderby' = 'menu_order',
            'order' = 'asc'
);

so i add another part of code to display posts by term:

$aProjectArgs = array(
            'post_type' = 'uni_project',
            'posts_per_page' = -1,
            'orderby' = 'menu_order',
            'order' = 'asc'
            'tax_query' = array(
    array(
    'taxonomy' = 'post_tag',
    'field' = 'id',
    'terms' = 43
     )
  )
        );

but its not working its give me an error message:Parse error: syntax error, unexpected ''tax_query''

can someone help me?

Topic parse tax-query errors Wordpress

Category Web


Replace your code with this one.

 $aProjectArgs = array(
                'post_type' => 'uni_project',
                'posts_per_page' => -1,
                'orderby' => 'menu_order',
                'order' => 'asc',
                'tax_query' => array(
        array(
        'taxonomy' => 'post_tag',
        'field' => 'id',
        'terms' => 43
         )
      )
            );

put , in 'order' => 'asc' 'tax_query'

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.