• Resolved senyoraangelica

    (@senyoraangelica)


    Hello! I’m displaying my pod items through this code

    <?php
    
    $params = array(
        'orderby' => 'book_year DESC',
        'limit' => 10,
    );
    
    $pod_books = pods( 'books' );
    
    echo $pod_books->filters(); 
    
    echo $pod_books->find( $params )->template( 'book_detail' );
    
    echo $pod_books->pagination();
    
    ?>

    The search form only searches for texts on the post title. ??
    How do I edit the code so that the search form will search the text through all or any of the custom fields on the pod as well?

    What should I be referencing in the pod codex?

    For example, I have a custom field named book_author in my pod. How do I allow the pods search form to search this custom field as well?
    Please help.

    https://www.ads-software.com/plugins/pods/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter senyoraangelica

    (@senyoraangelica)

    EDIT: This is the code I’m using, not the code in the first post. Sorry. How do I get this to search my custom fields as well?

    <form method="get" class="" action="">
            <input name="type" value="books" type="hidden">
    
            <input class="" name="search" value="" type="text">
    
            <input class="" value="Search" type="submit">
    </form>
    <?php
    
    $params = array(
        'orderby' => 'book_year DESC',
        'limit' => 2,
    );
    
    $pod_books = pods( 'books' );
    
    echo $pod_books->find( $params )->template( 'book_detail' );
    
    echo $pod_books->pagination();
    
    ?>
    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    The Pods search functionality does not yet support custom fields for post types. It only searches the primary text field (Post Title). You can request this feature to be addressed in a future release at https://pods.io/submit/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make pods search form search custom fields?’ is closed to new replies.