Support » Fixing WordPress » Search Excerpts?

  • I would like to modify my search functionality to include excerpts. How can I do this? I have an idea of how to rewrite the SQL statement, if the search query executes and SQL statement — just point me in the right direction!

Viewing 7 replies - 1 through 7 (of 7 total)
  • If I have a handle on what you want to do, you would just need to modify: the_content() tag in your search template to the the_excerpt() tag. Read the codex articles on Template Tags. I can’t see any possible reason that you would need to hack anything to do this simple, documented task.

    Cheers,
    Michael.

    Michael, that would display search results with the excerpt, but would not actually *search* excerpt field content.

    ashes, see if Jerome’s Search plugin works for you:

    http://vapourtrails.ca/wp-plugins

    I think ashes needs to clarify his/her question, as it is very ambiguous as to what exactly he/she wants done.

    Why would one want to specifically search the excerpt fields, excerpts are by definition an excerpt of the content and search already searches the content, doesn’t it?

    TechGnome

    (@techgnome)


    Moderator


    niziol – it seems perfectly clear to me…. search the excerpt instead of the content. The excerpt isn’t necessarily from the content anyways. It depends on how you use it. I use it as a teaser, and so my excerpts don’t repeat what’s in the actual content. I could think of serval reasons for wanting to search the excerpt instead of the content.

    -tg

    Excerpts are by definition just what you believe them to be: a brief excerpt of a post’s content. However, one can put just about anything they want in the excerpt field of a post, from an actual summary or excerpt of the post’s content to introductory text, an image, a personal note. Anything.

    When an actual exerpt exists, the_excerpt() will display that (rather than an excerpt of post content). WordPress does not touch this particular field when using the built-in search functionality.

    Sorry, I’ll clarify.

    I need to modify the Search field on my blog so that it searches not only article content, but also article excerpts.

    The reason? Sometimes I reference things in my article, but don’t put the full name, except in the excerpt; so the excerpt contains content that lets you identify something from out-of-context, which is useful sometimes.

    This is because I use different words in the excerpt and the article (slightly, but they have major ramifications to searchability).

    The plugin worked–thanks, Kafkaesqui! EXACTLY what I needed!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Search Excerpts?’ is closed to new replies.