Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

ACF field and Elementor post query

$
0
0

Replies: 0

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'); 	 

	
} );

Viewing all articles
Browse latest Browse all 59525

Trending Articles