Linux 软件免费装
Banner图

Ajax Filter Search

开发者 longislandfreelancewebdesigner
更新时间 2026年11月19日 02:06
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

shortcode custom post type pagination ajax filter search posts

下载

1.0.4 1.0.1 1.0.3 1.0.2 2.0.0 2.1.0 2.2.0

详情介绍:

Ajax Filter Search is a small but powerful plugin that displays your posts or custom post type in a list or grid with category tabs, search, month and year filters and pagination, all using ajax so there's no page reload. A visitor can filter your posts by search keyword, month, year and category to get the exact content they're looking for. It's a great tool for anyone looking to show a reel of press releases, blog posts, upcoming events, whatever you can think of. Features Example shortcodes [ajax_filter_search] [ajax_filter_search terms="news,press-releases" posts_per_page="12" layout="grid"] [ajax_filter_search post_type="event" post_tax="event_type" orderby="title" order="ASC" show_views="false"] Shortcode attributes All attributes are optional. Anything you leave out uses the setting from Settings > Ajax Filter Search. Please Rate Ajax Filter Search! Your ratings make a big difference! If you like and use Ajax Filter Search, please consider taking the time to rate the plugin. Your ratings and reviews will help this plugin grow and provide the motivation needed to keep pushing it forward.

安装:

Using The WordPress Dashboard
  1. Navigate to 'Add New' in the plugins dashboard
  2. Search for 'Ajax Filter Search'
  3. Click 'Install Now'
  4. Activate the plugin on the Plugin dashboard
Uploading in WordPress Dashboard
  1. Navigate to 'Add New' in the plugins dashboard
  2. Navigate to the 'Upload' area
  3. Select ajax-filter-search.zip from your computer
  4. Click 'Install Now'
  5. Activate the plugin in the Plugin dashboard
Using FTP
  1. Download ajax-filter-search.zip
  2. Extract the ajax-filter-search directory to your computer
  3. Upload the ajax-filter-search directory to the /wp-content/plugins/ directory
  4. Activate the plugin in the Plugin dashboard

屏幕截图:

  • Filtered results, with the filters kept in the address bar so the view can be shared.
  • Grid layout.
  • Two feeds with different settings on one page.
  • The redesigned settings screen, with a design picker, copyable shortcodes and the optional sort, filter chip and noindex settings.
  • The "Ajax Filter Search" block in the editor, with a live preview and controls, including the sort and filter chip options.
  • The feed on a phone.
  • The optional sort control and active filter chips, with Clear all.
  • An empty result, with a link to clear the filters.
  • The Classic design, the look of earlier versions.

升级注意事项:

2.2.0 Adds an optional Modern design (the default for new installs) and a redesigned settings screen. Sites that already use the plugin keep the Classic look unless they switch. Also fixes a delayed duplicate request after submitting a search. Recommended. 2.1.0 Adds optional sort, filter chips and an RSS feed (all off by default), cache validators for the results endpoint and noindex for filtered views. Existing feeds render as before. A site filter can no longer widen the post status beyond published. Recommended. 2.0.0 Major update. Back up your site and test on a staging copy first. The new markup and styles replace the old Bootstrap-based ones, so custom CSS, JavaScript and code that calls the legacy AJAX action may need adjusting. 1.x template overrides keep working. 1.0.4 Security update. Recommended for all users.

常见问题:

What are the steps to getting Ajax Filter Search to display on my website?

  1. Add the "Ajax Filter Search" block, or copy the shortcode [ajax_filter_search], into your page.
  2. Optionally adjust the defaults under Settings > Ajax Filter Search.
  3. View the page and watch Ajax Filter Search fetch your posts.

Is it possible to only display posts from 1 or 2 categories?

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.)

Can visitors sort the results or see which filters are active?

Yes, both are optional. Add show_sort="true" for a sort control and show_chips="true" for removable filter chips with a Clear all link (they also offer a way out when nothing matches). You can also use the matching block controls, or turn them on for every feed under Settings > Ajax Filter Search. They are off by default, so existing feeds look exactly as before.

Is there an RSS feed for a filtered view?

Yes. /wp-json/afs/v1/feed accepts the same parameters as the results endpoint (for example afs_term=news&afs_year=2025) and returns RSS 2.0 with published posts only. Developers can build the address with afs_feed_url() or remove the feed with add_filter( 'afs_enable_feed', '__return_false' );.

Will search engines index every filtered view?

No. A page that shows a feed and is opened with a filter, search or page number in the address is marked noindex, follow, so only the main page is indexed. You can turn this off under Settings > Ajax Filter Search or with the afs_noindex_filtered_states filter.

Is the ajax functionality secure?

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.

I'm upgrading from 1.x. What changes?

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).

Can I change how each result looks?

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.

Does it load anything from third-party servers?

No. Version 1.x loaded Font Awesome from a CDN on every page. Version 2.0.0 loads nothing external.

Can I keep the old look?

Yes. The Classic design is the look of earlier versions, and sites that already use the plugin keep it. New installs start with the Modern design. Change it under Settings > Ajax Filter Search > Appearance, or for one feed with design="classic" or design="modern" (the block has a Design setting too).

How do I change the colors?

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; }.

What happens to my data if I uninstall?

The plugin's single settings option is removed when you delete the plugin. Your posts are never touched.

更新日志:

2.2.0 2.1.0 2.0.0 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0