Breadcrumb
Overview
Displays a navigational breadcrumb trail showing the current page’s position within the site hierarchy.
- Block name:
method/bc - Category:
method-component-blocks - Supports:
align(wide, full) - Render type: Dynamic (PHP
render_callback) - Inner blocks: No
Usage
The Breadcrumb block renders a dynamic breadcrumb trail based on the current page’s position within the site. The trail structure is determined by Method’s theme options (method_options), which control separator characters, home link inclusion, current item display, and per‑post‑type/taxonomy parent behaviors.
Insert the block in a header template part or at the top of a page template. The editor shows a static placeholder with three sample items. The actual breadcrumb trail is generated server‑side.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
textColor | string | — | Text color of the trail |
linkColor | string | — | Link color; also applied to the last item |
responsiveSettings | object | (standard breakpoints) | Spacing, alignment, gap, and color per breakpoint |
Control Sets
| Component | Panel | Breakpoints | Notes |
|---|---|---|---|
MethodAlignmentControls | Alignment | base, mobile, tablet, wide | alignItems, justifyContent |
MethodSpacingControls | Spacing | base, mobile, tablet, wide | Padding (all sides), Margin (top/bottom), Gap (horizontal/vertical) |
MethodColorControls | Colors | global | textColor, linkColor |
MethodResponsiveTabs | Responsive | mobile, tablet, wide | — |
MethodStyleTag | — | — | Scoped editor styles |
Data
The breadcrumb trail is built entirely server‑side from the method_options option. Key option fields:
| Option Key | Description |
|---|---|
bc_sep | Separator character (default: /) |
bc_home | Whether to include a “Home” link at the start |
bc_current | Whether to include the current page/post as the final item |
bc_sep_inclusion | Whether to show the separator after the last item |
bc_{post_type}_behavior | Parent trail behavior: a page ID (walks up hierarchy) or archive_{cpt} (links to archive) |
bc_{post_type}_archive | Whether to include the post type archive in the trail |
bc_{post_type}_label | Custom label for the post type archive link |
bc_{taxonomy}_behavior | Parent trail behavior for taxonomy archives |
Custom title override
Both posts and terms support a custom breadcrumb title via meta:
- Posts/pages:
_method_bc_titlepost meta - Terms:
_method_bc_titleterm meta
When set, this overrides the default get_the_title() / $term->name in the breadcrumb trail.
Trail building logic
The PHP render callback determines the trail based on the current page type:
| Context | Trail Logic |
|---|---|
is_singular() | Resolves configured behavior → optional archive link → page ancestors → current item |
is_tax() / is_category() / is_tag() | Resolves configured behavior → term ancestors → current term |
is_post_type_archive() | Resolves configured behavior → current archive |
is_home() | Blog page title |
is_page() | Page ancestors → current page |
is_search() | “Search Results” |
is_404() | “Not Found” |
Frontend Rendering
<nav class="wp-block-method-bc" aria-label="Breadcrumb">
<ol class="method-breadcrumb-list">
<li class="method-breadcrumb-item">
<a href="/">Home</a>
<span class="method-breadcrumb-sep" aria-hidden="true">/</span>
</li>
<li class="method-breadcrumb-item">
<a href="/parent/">Parent Page</a>
<span class="method-breadcrumb-sep" aria-hidden="true">/</span>
</li>
<li class="method-breadcrumb-item">
<span aria-current="page">Current Page</span>
</li>
</ol>
</nav>
The current (final) item renders as a <span aria-current="page"> instead of a link. Separator visibility on the last item is controlled by the bc_sep_inclusion option.
Filters
This block does not currently expose dedicated PHP filters for trail modification. Trail behavior is configured entirely through the method_options option page. CSS customization targets #method-{id} selectors and the .method-breadcrumb-* class structure.
Changelog
| Version | Description |
|---|---|
| 2.0.0-beta5 | Introduced (8831843). |
| 2.0.0-beta6 | Responsive CSS through method_get_block_responsive_styles() — gap, justification, alignment, padding, margins, text and link color per breakpoint, scoped to a #method-{id} wrapper — and the textColor / linkColor attributes (09cc16b). |
| 2.0.0-beta17 | Inserter title prefixed, “Method Breadcrumb” (c34e9bb). |
| 2.0.0-beta22 | Retitled “Breadcrumb (Method)” and given the method keyword (93e1fcf). |