Glossary

Template Part — Объяснение повторно используемых частей шаблонов WordPress

Части шаблона — это повторно используемые компоненты в блочных темах WordPress. Узнайте, как они работают и чем отличаются от классических PHP-шаблонов.

Definition

A template part is a saved block snippet in a WordPress block theme that can be used across multiple templates. The most common use case: header and footer as template parts appearing on all pages. Since Full Site Editing (WordPress 5.9), template parts can be edited directly in the editor — no PHP knowledge required.

Template parts vs. classic PHP templates

In classic WordPress themes, the header is defined in `header.php` and the footer in `footer.php` — editable only by code. In block themes, header and footer are template parts: visually editable in the Full Site Editor, stored as HTML files with Gutenberg block markup in the `/parts/` folder.

Creating and editing template parts

In the Full Site Editor (Appearance → Editor), existing template parts can be edited or new ones created. New parts are saved as HTML files in the theme. Template parts are included in templates via `<!-- wp:template-part {"slug":"header"} /-->`.

Template parts and anipage.io

anipage.io generates complete page content as Gutenberg block markup — including header- and footer-like sections. The export contains the page content (without theme template parts), which can be imported into existing WordPress themes without overwriting existing template parts.

Frequently Asked Questions

What is a template part in WordPress?
A template part is a reusable block snippet (e.g. header or footer) edited in block themes via the Full Site Editor, used across multiple page templates.
Can I edit template parts without coding?
Yes. In the Full Site Editor (WordPress 5.9+), template parts can be edited visually — no PHP or coding knowledge required.
Do I need a block theme for template parts?
Yes. Template parts are a feature of block themes. Classic themes use PHP template files instead of WordPress blocks.

Готовы создавать страницы WordPress за минуты?

Начните бесплатно с 3 генерациями в месяц. Без кредитной карты. Без обязательств. Отмена в любое время.

Начать бесплатно сейчас

Related Terms

Related Articles