WDV Ajax Search (Doc)

WDV Ajax Search

  • 0. General information - top

    WDV Ajax Search (WordPress plugin) – with this plugin you can create different search forms for different post types your site and put their shortcode on the corresponding page.

    • 1. Installing - top

      • Upload the plugin files to the '/wp-content/plugins/wdv-ajax-search' directory, or install the plugin through the WordPress plugins screen directly.
      • In your WordPress administration, go to the Plugins page.
      • Activate the WDV Ajax Search plugin through the ‘Plugins’ screen in WordPress.
      • 2. How to use - top

        • 2.1. Admin part - top

          If you want to create special search form for any post type you must open tab "Search form (for site)" and press button "Create new search form!":

          Now you can create search form:

          You can see shortcode for your search form and you can choose settings or delete form if you do not need it:

        • 2.2. Form settings. General - top

          Now you press button "Add/Edit Settings" and choose settings that you need. On General options, in paragraph 1 - " Search in custom post types" you can see list of all post types that exists on your site. Here you can choose post type. For example you want to make search form for searching in post type "wdvdocs":

          In paragraph 2 - "Search by" you can choose - the search will be carried out only by post titles or by post titles and content.

          In paragraph 3 you can write that message will see your custome if there are not records found (for example - "No record found").

          In paragraph 4 you can write how many search result show on one table page with search results.

        • 2.3. Form settings. Image - top

          On the tab "Image" you can choose whether to show images in search results. You can choose size of the pictures and select the default image which will be shown if post have no picture:

        • 2.4. Form settings. Layout - top

          On the "Layout" tab you can choose how the search form will look like:

        • 2.5. How it look like on your site - top

          Adding a shortcode to a page.

          You can add the shortcode directly to the page where you want to see the search form. For example, you installed the documentation plugin for your products. Perhaps it does not have a search form and you can add a shortcode to search for documents to the page that displays the list of documents.

          Adding a shortcode to a page:

          That may look like a search form on the site page:

          Adding a shortcode to an archive.

          Perhaps you want to place the shortcode on the archive page. If your theme has a special template for your custom post type - this is how you can add the shortcode in this case:

          If your theme has no a special template for your custom post type - this is how you can add the shortcode in this case:

          Code:

          <?php if (is_post_type_archive('event')) {
          	echo do_shortcode('[wdvajaxsearch form_name="Events"]');
          }
           ?>

          When a site visitor enters search text into the form, search results appear below the form:

          If during the creation of the form on the tab "General -> Search by" the item "Title" was selected and the visitor can simply open the found pages.
          If during the creation of the form on the "General -> Search by" tab the item "Title & Content" was selected and the visitor opens any of the found pages - on this page the found search text will be highlighted in color:

          Adding a shortcode to the blog page.

          If your want to place the search form on blog page for searching in posts you must add the shortcode usually in index.php:

          This is how the search form will look on the blog page:

      • 3. Real examples - top

        Page aniro.wdvillage.com/services contains a service search form. Here the search is carried out by headings (you can use for example "book" as a search word): Services (When the search is carried out by headings, then when opening the found pages, the search word is not marked there.)

        Here you can see search form on blog page: Blog (you can use for example "room" as a search word).

        Page aniro.wdvillage.com/rooms contains a search form for the description of rooms. Here, the search is carried out by the titles and content of the page (you can use for example "bed" as a search word): Rooms (When the search is carried out by the titles and content of the page, then when you open the found pages, the search word there is highlighted in color).

        Scroll to top