WordPress.org

Ready to get started?Download WordPress

Forums

Excerpt contents not searched-Possible? (8 posts)

  1. ccheaton
    Member
    Posted 10 years ago #

    On my site, I post articles from various news sources, many of which are free to copy as long as you retain a copyright notice. Others cannot be copied, so this is what I want to do with those so that they are still searchable, but I'm not distributing the article against the terms of the copyright:
    For the regular articles, I will just put the text of them in the contents area. For the copyrighted articles, I want to put the full text of them in the Excerpt area (which is not displayed) and just have the title and link show on the page. I already have this working. See the top article at http://www.publichealthcenter.com
    The problem is that the search field, on the News Archives page (which is the default blog index and default search function) does not search the contents of the Excerpt field.
    How can I get the default search funtion to search the article Excerpts and Contents?

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

  3. ccheaton
    Member
    Posted 10 years ago #

    It may, but I'm not sure. I'll email and ask. Thanks for the link!

  4. ccheaton
    Member
    Posted 10 years ago #

    Unfortunately, it searches titles and the main content, but not the excerpt, and then it returns the entire excerpt (which is the copyrighted article, in my case, so unacceptable). I'm going to futz around with it and see if I can modify it to what I need.

  5. carthik
    Member
    Posted 10 years ago #

    I guess you have to replace other occurences of post_content as well and give it a shot.

  6. ccheaton
    Member
    Posted 10 years ago #

    Well, the reason I ask is because it its current state, with just the one change, it seems to search both the content and the excerpt. However, I doubt that there's redundancy like that in the code, so I guess that there are several cases here. I'm wondering what the terms of the case that I changed are.

  7. carthik
    Member
    Posted 10 years ago #

    In the current state, the search results are built up using all those loops, so that's why I suggested what I did to see if it then searches only the excerpt.

  8. ccheaton
    Member
    Posted 10 years ago #

    Sorry - I don't think I was clear above.
    I would prefer it to function like it seems to currently function - that is, search the excerpts and the contents. So, I hope that how it currently seems to be working will not break under certain circumstances. To clarify my question, I am wondering, based on the design of the search loops and my lack of knowledge of the code, is there is a case where it will not work in the manner that is currently is working?
    Maybe there isn't, but if there is, and somebody can recognize the case by the code that I posted above, then I would just like to be aware of it so that I can inform users of my site.
    I appreciate your help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags