Home Forums General Issues ACF subfield and WordPress combined search


ACF subfield and WordPress combined search

  • I want to live search the posts with meta query in it.
    There are repeaters inside the repeater field like

    Post Type: Post
    Level1 Repeater: Level1
    Level1 Sub field repeater(Level 2) : Level 2
    Level 2 repeater subfields: description, title, number

    I want a query to show the post by matching the provided search text like ‘co’, which search the post title, the subfield description, and number and returns the matching post.
    Is there any way to achieve this?
    Below is my query show far.

    $post_meta_args = array();
    if ( is_array( $myValues ) || is_object( $myValues ) ) {
    foreach ( $myValues as $value ) {
    array_push( $post_meta_args, array(
    'key'     => 'description',
    'value'   => 'mar',
    'compare' => 'LIKE'
    ) );
    $args = array(
    'post_type'      => 'post',
    'posts_per_page' => - 1,
    's'              => 'co',
    'meta_query'     => $post_meta_args
    // query
    $the_query = new WP_Query( $args );
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.