Back to contents

JetSearch. How to set the source of post content in Ajax Search widget results area

This tutorial will assist you in improving your knowledge about JetSearch plugin. You will learn about how to specify the source of post content displaying in the search results with the help of Ajax Search widget.

With JetSearch plugin it’s available to use the Ajax Search widget which can help you to set the information (from the post content, post excerpt or a custom field) from the post that will be displayed in the search results.

Settings the source of the post content in the results area

1 Step — Setting the search area

Go to the page, where you use the Ajax Search widget and open the widget’s settings. Here you can see a lot of different options for customizing the widget as you wish. In the Search Query tab, there is the Source field, where you should select the appropriate post type, in which you want to implement the search.

Search query settings in Ajax Search widget

2 Step — Customizing the search results area

After that, uncover the Results Area tab and find the Post Content Source option. There are three available picks:

  • Select the Post Content option if you want to display the content of the post in the search results.
    Results Area settings in Ajax Search widget

    In our example, there is the Wild Nature Argentina custom post with certain content.

    Wild Nature Argentina custom post
    Ajax Search widget
  • The Post Excerpt option is useful in case you are going to present an excerpt of the post in the results window.
    Results Area settings in Ajax Search widget

    We have the post excerpt in the Wild Nature Argentina custom post:

    Excerpt settings in Ajax Search widget
    Ajax Search widget
  • Choosing the Custom Field option you should specify the meta field, from which the data will be displayed.In our case, we have the Tour custom post type, where there are various tours. In the _status meta field of the custom post, we specify the tour is the hot deal or not. We want to display this information in the search output.
    Meta field status of the custom post
    Results Area settings in Ajax Search widget
    Ajax Search widget

Excellent! Now you know how to customize the source of the post content in the search results area in JetSearch Ajax Search widget.