https://github.com/morning-train/wp-breadcrumbs
Breadcrumbs for WordPress
https://github.com/morning-train/wp-breadcrumbs
breadcrumbs php wordpress wp
Last synced: 4 months ago
JSON representation
Breadcrumbs for WordPress
- Host: GitHub
- URL: https://github.com/morning-train/wp-breadcrumbs
- Owner: Morning-Train
- License: mit
- Created: 2023-01-18T09:57:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-24T12:16:29.000Z (over 1 year ago)
- Last Synced: 2025-09-28T14:17:08.110Z (9 months ago)
- Topics: breadcrumbs, php, wordpress, wp
- Language: PHP
- Size: 13.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Morningtrain\WP\Breadcrumbs
Autogenerated breadcrumbs for WordPress.
## Table of Contents
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)
## Introduction
This package is made to make it simple to add breadcrumbs to WordPress.
## Getting started
To get started install the package as described below in [Installation](#installation).
To use the package have a look at [Usage](#usage)
### Installation
Install with composer.
```composer require morningtrain/wp-breadcrumbs```
## Usage
To get started with the module simply compose and render the breadcrumbs.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->render();
```
### Change Seperator
You can change the seperator by calling `seperator` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->separator(' >> ')->render();
```
### Hide on Front Page
You can easily hide the breadcrumbs on the frontpage by calling `hideOnFrontPage` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->hideOnFrontPage()->render();
```
### Remove Prefixed Front Page
You can remove the prefixed front page breadcrumb on all pages by calling `hidePrefixedFrontPagePart` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->hidePrefixedFrontPagePart()->render();
```
### Exclude terms
You can easily hide the terms from the breadcrumbs by using `excludeTaxonomies` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->excludeTaxonomies(['category'])->render();
```
### Exclude post type archive
You can easily hide the post type archive from the breadcrumbs by using `excludePostTypeArchives` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->excludePostTypeArchives(['post'])->render();
```
### Alternative to Render
If you will create your own markup, you can get all breadcrumb parts by calling `getBreadcrumbs` on the BreadcrumbGenerator.
```php
\Morningtrain\WP\Breadcrumbs\Breadcrumbs::compose()->getBreadcrumbs();
```
## Credits
- [Martin Schadegg Brønniche](https://github.com/mschadegg)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.