Forums

How do you modify WP default search? (2 posts)

  1. rudiegirl
    Member
    Posted 1 year ago #

    Hi!

    I've searched and found some great stuff on the default WP search, but not exactly what I was looking for.

    I want to modify the default search to look at a specific table, a new table that I have created, in addition to the regular posts that it already searches. I don't think a plugin will work for this because I'm not adding something that was already in the WP database like comments or pages.

    Can someone please tell me how the search works as in where is the code? I've read that it is only searching wp-posts, but I'm thinking if I knew where the code was, I could add another table or two to the search so that it searches more than just posts. Where is the search code?

    I am using WP 2.3.1 and I am adding a custom search page to my theme.

    Thanks!

  2. Kafkaesqui
    Moderator
    Posted 1 year ago #

    Your table doesn't have to be original to WordPress for a plugin to work, it just needs to exist in the same database.

    See the source of my Search Custom plugin for one way you could go about adding a table (or perhaps even replacing the posts table with it) that's not normally handled through the standard search query:

    http://guff.szub.net/source/search-custom.php

Topic Closed

This topic has been closed to new replies.

About this Topic