Forums

How to customize the search results? (2 posts)

  1. Anonymous
    Unregistered
    Posted 3 years ago #

    Hi,

    Just started with customizin WordPress to my own needs.

    Regarding the search results I have two requirements.
    - only search in posts (not pages, comments, or somewhere else).
    - display a little non-html preview (just like Google); let's say display the first 50 words.

    I have made a search.php file and use this code parts:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?> // Skip pages, how?
    <?php the_content(__('Read more...')); ?> // Need to change this, how?

    Suggestions are welcome!

    Thank you very much!

  2. omgitztrey
    Member
    Posted 3 years ago #

    1. Use a plugin
    2. you would be using the excerpt instead of the content.

Topic Closed

This topic has been closed to new replies.

About this Topic