开发者 | scottsweb |
---|---|
更新时间 | 2015年7月7日 22:44 |
捐献地址: | 去捐款 |
PHP版本: | 4.0 及以上 |
WordPress版本: | 4.3 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
instant-search-suggest
folder to the /wp-content/plugins/
directorySettings -> Instant Search
if requiredThe plugin has two filters, both of which allow you to customise the search suggestion results. The filters are: wpiss_post_tempalte
and wpiss_taxonmy_tempalte
.
You should return a valid mustache template to both of these. You can see an example in assets/inc/iss-theme.php
.
Variables available in your mustache template for posts/cpts are: title
, permalink
, postdate
, posttype
, categories
and image
.
Variables available in your mustache template for taxonomies are: title
, permalink
, taxonomy
and count
.
For around 70% of WordPress themes instant search will just work. If you find that your instant search feature is not working then you will need to tweak the settings from within WordPress.
Head to the administration menu for the plugin within your WordPress admin panel. You will find it in Settings » Instant Search
.
HTML pages are made up of various sections (usually DIVs) and these sections have unique names to describe what they do. For most WordPress themes the main content area is wrapped in a DIV with an ID of 'content'. Therefore the default setting for Instant Search is "#content". If instant search is not working then we need to change this value to match your current theme layout.
Leave the Instant Search #id/.class
setting empty to disable instant search.
With Magic Mode enabled the user is automatically transported to the post, page, custom post type or taxonomy they have selected in the suggestions list. With Magic Mode enabled the user is automatically transported to the post, page, custom post type or taxonomy they have selected in the suggestions list.
Uncheck all of the taxonomies and post types in the Search Suggest
setting.
Yes. You can control which of these appear in the suggestion list from the setting screen.
We have purposely left the styles on the suggestion dropdown simple to fit many themes. If you wish to customise the CSS copy the iss.css
file from the plugin folder (/assets/css/) to the root of your theme and edit the CSS to match your design.
If you wish to change the output of the suggestions please see the hooks and filters section above.
You can also dequeue iss.css
and move the styles to your own CSS file using: wp_deregister_style('iss');