WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
search in custom field (7 posts)

  1. giubilo
    Member
    Posted 2 years ago #

    Hi,
    I'm using this plugin and i like it very much. Thank you!
    I would like to know if it possible to search in custom field.
    How can i do?

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the note. Do you need to search or do you need a search form?

    All custom field data is stored in the wp_postmeta table -- the only fields that are a bit obscured are the multi- fields -- they store data in JSON-encoded arrays. There are many ways to search on the wp_postmeta table -- in theme files, I usually use the GetPostsQuery() object (included in the CCTM). See http://code.google.com/p/wordpress-summarize-posts/wiki/Examples_get_posts for examples.

  3. giubilo
    Member
    Posted 2 years ago #

    Thanks for your reply!
    I would like to modify the wp standard search, it should be able to find the words also in custom contents, from your link I don't understand how to do it... thanks for your pacience!

  4. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    That's gonna be tough -- search forms can require a lot of customized code, I'm afraid. If we all had Google's budget, we could make it look easy ;) I've done projects for clients where the only deliverables were search forms, if that gives you an idea of the potential complexity.

    Even if I had finished/polished my "helper" code here, the answer would be long and it would be more of a tutorial, unfortunately. Hopefully, I'll have such a tutorial soon (projects permitting), but right now, the only thing I can point you towards is the GetPostsQuery() object and its get_posts() method: http://code.google.com/p/wordpress-summarize-posts/wiki/get_posts

    You'll have to build an HTML form and handle submissions and result-formatting, but at least the form inputs are quite flexible so you should be able to drill down to find any posts you require.

  5. Mike
    Member
    Posted 2 years ago #

  6. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Is that the correct link?

  7. Mike
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic