Main/WordPress Fullstack/Blueprints/Custom Themes/Equipment Catalog with Custom Post Types, Taxonomies & AJAX Filtering
Back to «Custom Themes» cards
Custom Themes(ТЗ 19 из 54)
Spec: Equipment Catalog with Custom Post Types, Taxonomies & AJAX Filtering
Custom Themes7 шагов • +35 XP

Spec: Equipment Catalog with Custom Post Types, Taxonomies & AJAX Filtering

Full-cycle catalog theme development: custom post type (CPT) registration, hierarchical taxonomies, main query customization via pre_get_posts, archive templates, and fast Fetch API filtering with Nonce security.

~14 ч работыУровень: MiddlePHP 8.3/8.4register_post_typeregister_taxonomypre_get_postsarchive-{cpt}.phpsingle-{cpt}.phpAJAX / Fetch APISchema.org Breadcrumbs
+5 XP за шаг
Выполнено 0 из 7 шагов (0%)
Трудозатраты~14 рабочих часов
Фриланс вилка~$630 – $1,050 (€560 – €980)
Оценка веб-студии~$1,330 – $2,240 (€1260 – €2100)

ТЗ заказчика (исходный бриф):

We need an equipment and machinery catalog website. The WordPress dashboard must have a separate 'Equipment' menu with custom taxonomies (Categories, Brands) and technical specs, plus instant filtering on the frontend without full page reloads.
Ключевые требования:
  • •Custom Post Type 'equipment' with full REST API, Gutenberg, and rewrite slug support
  • •Custom Taxonomies: 'equipment_category' (hierarchical) and 'equipment_brand' (non-hierarchical)
  • •Archive template with responsive card grid and custom technical specification meta fields
  • •Instant AJAX / Fetch API filtering by category, brand, and price range without page reload
  • •Schema.org Product and BreadcrumbList JSON-LD structured data for rich search snippets
Ограничения проекта:
  • •Must preserve clean URLs for direct linking to pre-filtered categories (SEO friendly)
  • •No heavy query plugins (no Search & Filter Pro, FacetWP) — lightweight native code only
  • •Database queries must be optimized with WP_Query and proper index usage
Критерии приёмки (KPI):
  • AJAX filter response time under 200ms
  • Google Rich Results test validates 100% valid Product schema markup
  • Zero 404 rewrite errors after permalink flushes

Пошаговое практическое руководство по ТЗ

Подробный разбор архитектуры, код реализации и советы эксперта по каждому этапу:

1
Этап 1 из 7

Step 1: CPT registration via register_post_type with rewrite rules

~40 минСредний

Практическое руководство:

Register 'equipment' CPT inside the init hook. Configure supports (title, editor, thumbnail, excerpt), show_in_rest for block editor support, menu_icon, and custom rewrite slug ('catalog/equipment').

План и контрольные точки реализации:
1Зарегистрировать CPT на хуке init
2Задать ЧПУ has_archive => "catalog"
3Включить show_in_rest => true для поддержки Gutenberg и REST API
4Настроить однократный сброс ЧПУ на after_switch_theme
Важные технические нюансы и подводные камни:

Always flush rewrite rules on theme activation using flush_rewrite_rules(). Never run flush_rewrite_rules on every page load.

Ожидаемый артефакт этапа:

Новый раздел "Каталог" в админке с корректным ЧПУ /catalog/.

PHP
<?php
// inc/cpt.php - Регистрация типа записи оборудования
add_action('init', function (): void {
    $labels = [
        'name'               => 'Оборудование',
        'singular_name'      => 'Оборудование',
        'menu_name'          => 'Каталог',
        'add_new'            => 'Добавить позицию',
        'add_new_item'       => 'Добавление позиции оборудования',
        'edit_item'          => 'Редактировать позицию',
        'all_items'          => 'Все позиции',
        'search_items'       => 'Поиск по каталогу',
    ];

    register_post_type('equipment', [
        'labels'             => $labels,
        'public'             => true,
        'has_archive'        => 'catalog',
        'rewrite'            => ['slug' => 'catalog', 'with_front' => false],
        'menu_icon'          => 'dashicons-portfolio',
        'supports'           => ['title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'],
        'show_in_rest'       => true,
    ]);
});

// Однократный сброс rewrite-правил при активации темы
add_action('after_switch_theme', function (): void {
    flush_rewrite_rules();
});
2
Этап 2 из 7

Step 2: Taxonomy registration: Categories & Brands

~35 минСредний
3
Этап 3 из 7

Step 3: Main query modification via pre_get_posts hook

~30 минСредний
4
Этап 4 из 7

Step 4: Archive template archive-equipment.php & pagination

~45 минСредний
5
Этап 5 из 7

Step 5: Real-time AJAX/Fetch API filtering with Nonce security

~55 минСредний
6
Этап 6 из 7

Step 6: Single page template single-equipment.php & specs table

~45 минСредний
7
Этап 7 из 7

Step 7: Schema.org BreadcrumbList & Product structured data

~30 минЛегкий

Типичные грабли на этом ТЗ

2 антипаттерна

Инструменты экосистемы Fullstack AI Lab для этого ТЗ

Интеграция