Support » Plugin: Pods - Custom Content Types and Fields » How to make pods search form search custom fields?

  • 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.

    http://wordpress.org/plugins/pods/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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 Author 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 http://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.