WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] How to make pods search form search custom fields? (3 posts)

  1. senyoraangelica
    Member
    Posted 12 months ago #

    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/

  2. senyoraangelica
    Member
    Posted 11 months ago #

    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();
    
    ?>
  3. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 11 months ago #

    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/

Reply

You must log in to post.

About this Plugin

About this Topic