concept-image/wp-search 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

concept-image/wp-search

最新稳定版本:1.0.2

Composer 安装命令:

composer require concept-image/wp-search

包简介

A package for adding search components with Roots - Bedrock/Acorn/Sage

README 文档

README

WP Search is a Composer package that provides Blade components and server-side logic to add search functionality to a WordPress Bedrock/Acorn/Sage project.

Installation

Install the package via Composer:

composer require concept-image/wp-search

Publish views

After installing the package, publish the view, component and config files so you can customize them:

wp acorn vendor:publish --tag="wp-search"

Configuration

Configuration options live in config/search.php. Modify this file to change default behavior. In this file you need to set your desired options, such as:

  • post_types: An array of post types to include in search results.
  • default: The engine you wish to use for the search. (wp_query or swp_query)

If you use SWP_Query, you need to install the plugin with composer.

Usage

Once the views are published, you can edit them under :

  • resources/views/components/search/ for the search components like toggle buttons, filters, and results.
  • resources/views/components/cards/search-card.blade.php for the search result card.

To add the search popup you can add this component after the <main> on your app template :

  • <x-search-popup />

You can add a button to open/close the search popup with the component :

  • <x-search-button />

And Finaly you must add the Alpine.js DATA to the body tag for the search popup to work.

  • x-data="{ searchOpen: false }"

Contributing

Contributions are welcome. Please open an issue or submit a pull request with a clear description of the change.

License

This package is open-source under the MIT license. See LICENSE.md for details.

统计信息

  • 总下载量: 186
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-22