Is it possible to write a query to search for data from one custom field only? I have a CPT called 'lectures' and I only want to search for data that is in the custom field called 'keywords' I have this:
<?php
$args = array(
'post_type' => 'lectures',
'order' => 'ASC',
'posts_per_page' => -1,
'meta_key' => 'keywords'
);
$query = new WP_Query($args);
while ( $query -> have_posts()) : $query -> the_post();
?>
but it is not working. So if someone searches for 'Operant Conditioning' (one of the terms in the keywords ACF). I want any CPT with those 'keywords' (from the ACF) to show in results. I cannot add a specific keyword as there will be hundreds