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
    • place on pages or posts a button that opens a search form on this page (the search text will be highlighted)

    • 1. Installing - top

      After buing plugin 'WDV Ajax Search' you will get ZIP file - wdv-ajax-search.zip. You can install plugin in 2 ways.

      Downloading the zip archive with the plugin from the admin panel (admin panel):
      • you need to go to the admin panel section: Plugins -> Add new and click on the button: Upload plugin
      • next, click Choose file, select our ZIP archive from your computer. Then click Install now
      • after the plugin is loaded, click on the link: Activate plugin.
      Uploading the plugin to the server via FTP:
      • unpack zip file (it will contain the plugin folder)
      • upload the plugin folder from the downloaded zip archive to your WordPress plugins directory: /wp-content/plugins/
      • go to the admin panel in the Plugins section and activate the plugin
      • 2. How to use. - top

        With this plugin you can create 2 types of shortcodes:

        • shortcodes for create special search forms for different post types and put it on the corresponding pages (3. How to use. Search form for specific post types)
        • shortcode for adding a search form on the page (4. How to use. Search form to search on the page)
        • 3. How to use. Search form for specific post types - top

          • 3.1. Search form for specific post types. 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:

          • 3.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.

          • 3.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:

          • 3.4. Form settings. Layout - top

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

          • 3.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:

        • You can add a button to your pages or posts that opens a search form for searching on this page. In the "Search form (for page)" section, you can choose where you want to show this button - only on pages, only in posts, or both on pages and posts or on product pages. You can also use a shortcode.

          If you want to have search form for searching on pages or posts or product pages you can check checkbox it in part "Show button for searching on page". Your visitors will see search button on the top of page or post or product pages. In part "Search button settings" you can choose how this button will look like. The button will not be shown on the front page, on blog page, on page 404, on page with archives, page with categories, page with tags, on page with search results and in admin part of your site. If you do not want to show the search button on all pages or on all posts, you can add a shortcode [wdvajaxsearch-postpage] to a specific page and then the button will be visible only on it.

          You can also change the appearance of this button.

          When searching, the search word will be highlighted in the body of the page. This is how it will look - here you can see button on page:

          Here you see the search result:

          • 5. Real examples - top

            Search form for specific post types

            This site is a site with a demo wordpress theme and the text on it is created by a text generator. This page 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.)

            This page 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 "bedroom" 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.)

            Search form to search on the page:

            On this page you can see how shortcode [wdvajaxsearch-postpage] will work on page: WDV About Me Widget PRO.

            Scroll to top