承接 humanmade/hm-primary-category-block 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

humanmade/hm-primary-category-block

Composer 安装命令:

composer require humanmade/hm-primary-category-block

包简介

Displays the primary category for a post.

README 文档

README

Displays the primary category for a post in the WordPress block editor.

Features

  • Displays the primary category for a post
  • Supports Yoast SEO primary category selection
  • Server-side rendered for optimal performance

Usage

The Primary Category block is automatically available after plugin activation. The block uses the postId context and is typically used within:

  • Query Loop blocks
  • Post Templates
  • Single post layouts

How it works

  1. The block automatically detects the post ID from context
  2. If Yoast SEO is active, it uses the primary category set by Yoast
  3. For posts with multiple categories, it returns the top-level parent category
  4. For single category posts, it returns that category

Block Name

The block is registered as hm/primary-category and can be inserted programmatically or used in block patterns.

Customization

The block outputs a link with the class hentry__category which can be styled via CSS:

.hentry__category {
    /* Your custom styles */
}

Installation

  1. Clone this repository to your WordPress plugins directory
  2. Run npm install to install dependencies
  3. Run npm run build to build the block
  4. Activate the plugin in WordPress

Development

  • npm start - Start development mode with hot reload
  • npm run build - Build production files
  • npm run lint - Run linters

Requirements

  • WordPress 6.0+
  • PHP 8.2+
  • Node.js 22+

Release Process

Merges to main will automatically build to the release branch. A project may be set up to track the release branch using composer to pull in the latest built beta version.

Commits on the release branch may be tagged for installation via packagist and marked as releases in GitHub for manual download using a manually-dispatched "Tag and Release" GH Actions workflow.

To tag a new release,

  1. Review the unreleased features in the Changelog and choose the target version number for the next release using semantic versioning
  2. Checkout a prepare-v#.#.# branch. In that branch,
  3. Open a pull request from your branch titled "Prepare release v#.#.#"
  4. Review and merge your "Prepare release" pull request
  5. Wait for the release branch to update with the build that includes the new version number
  6. On the "Tag and Release" GH Action page],
    • Click the "Run workflow" button in the "workflow_dispatch" notification banner (see screenshot below)
    • Fill out the "Version tag" field with your target version number
      • This version must match the version in hm-primary-category-block.php and your newest Changelog section
      • Use the format v#.#.# for your version tag
    • Leave the "Branch to tag" field as release (we will add the tag on the release branch containing the latest built code)
    • Click "Run workflow"

Screenshot of Run workflow dropdown form being filled out

Once the workflow completes, your new version should be tagged and available in the list of releases

License

GPL-2.0-or-later

humanmade/hm-primary-category-block 适用场景与选型建议

humanmade/hm-primary-category-block 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 humanmade/hm-primary-category-block 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 humanmade/hm-primary-category-block 我们能提供哪些服务?
定制开发 / 二次开发

基于 humanmade/hm-primary-category-block 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-02-23