| 开发者 | longislandfreelancewebdesigner |
|---|---|
| 更新时间 | 2026年10月30日 22:26 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[ajax_filter_search] shortcode anywhere.--afs-* CSS variable. Developers can override the item template and use filters.post_type - post type slug.post_tax - taxonomy slug used for the category tabs (or none).terms - comma separated term slugs to limit the feed to. (filter_by and filter_type are accepted as older names for the same thing.)posts_per_page - 1 to 100.layout - list or grid, the layout the feed starts in.orderby - date, title or modified. order - DESC or ASC.search - a keyword to start with. filter_years / filter_months - start on a year (for example 2025) or month (1 to 12).show_tabs, show_views, show_search, show_months, show_years - true or false.ajax-filter-search.zip from your computerajax-filter-search.zipajax-filter-search directory to your computerajax-filter-search directory to the /wp-content/plugins/ directory[ajax_filter_search], into your page.Yes. Add the terms attribute with the term slugs you want, separated by commas, for example [ajax_filter_search terms="news,events"]. Make sure the slugs belong to the taxonomy selected for that post type. (If you used filter_by with an older version, it still works.)
The filters call a read-only REST endpoint (/wp-json/afs/v1/results) that only ever returns published content of public post types. All incoming values are validated and sanitized on the server, and the endpoint cannot change anything on your site, so no nonce is needed.
Version 2.0.0 is a major update. Please back up your site and try it on a staging copy first. The feed has new markup and a small new stylesheet, so custom CSS written for the old Bootstrap-based markup needs updating, and the Font Awesome icon font is no longer loaded. Theme template overrides keep working. A compatibility layer keeps the 1.x functions, constants, the first feed's element IDs, the old script handles and the old ajax action working for now; it is deprecated and can be switched off with add_filter( 'afs_enable_legacy_compat', '__return_false' );. The filter_by attribute now limits a feed to category slugs, as the 1.x readme described; use search for a starting keyword. A short migration guide is in the plugin's GitHub repository (docs/MIGRATION-1.x-to-2.0.md).
Yes. Copy afs-template/default.php from the plugin folder into your-theme/afs-template/default.php (a child theme is checked first) and edit it. Templates written for version 1.x keep working. You can also use the afs_query_args and afs_template_file filters.
No. Version 1.x loaded Font Awesome from a CDN on every page. Version 2.0.0 loads nothing external.
Pick the accent color under Settings > Ajax Filter Search. For more control, set CSS variables in your theme, for example .afs { --afs-accent: #0a7; --afs-radius: 0; }.
The plugin's single settings option is removed when you delete the plugin. Your posts are never touched.
terms, layout, orderby, order, search, show_tabs, show_views, show_search, show_months, show_years. filter_by now does what the old documentation said (limit to category slugs).--afs-* CSS variables.afs_query_args and afs_template_file filters.ajaxurl / scriptpath globals on feed pages. Switch it off with the afs_enable_legacy_compat filter.uninstall.php removes the plugin's setting on deletion.