• I am trying to query posts with a certain value in an ACF field. Here is the code. What am I missing? The ACF field is spname and I want the posts with Critter in that field. Any help is appreciated.

    / Query Posts by Tags employees= User ID
    add_action( 'elementor/query/querytags2', function( $query ) {
    	
    	global $current_user;
       wp_get_current_user();
    
    	
    	$d =   $current_user->user_login;
    //	echo $d;
      	 $query->set( 'category_name' , 'dog'); 
     // $query->set( 'tag' , 'bob'); 	 
          $query->set( 'spname' , 'Critter'); 	 
    
    	
    } );

The topic ‘ACF field and Elementor post query’ is closed to new replies.