PHPackages                             jjgrainger/wp-crumbs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jjgrainger/wp-crumbs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jjgrainger/wp-crumbs
====================

Simple Wordpress Breadcrumbs.

v1.0.2(11y ago)3910.9k↓100%12[1 issues](https://github.com/jjgrainger/wp-crumbs/issues)MITPHPPHP &gt;=5.3.0

Since Oct 25Pushed 5y ago4 watchersCompare

[ Source](https://github.com/jjgrainger/wp-crumbs)[ Packagist](https://packagist.org/packages/jjgrainger/wp-crumbs)[ Docs](https://github.com/jjgrainger/wp-crumbs)[ RSS](/packages/jjgrainger-wp-crumbs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

WP Crumbs v1.0.2
================

[](#wp-crumbs-v102)

> Simple Wordpress Breadcrumbs

[![Build Status](https://camo.githubusercontent.com/106bbb54758a4b44db79d4e72829f0d303784c68fd191b5e435b78cd93d49dda/68747470733a2f2f7472617669732d63692e6f72672f6a6a677261696e6765722f77702d6372756d62732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jjgrainger/wp-crumbs) [![Total Downloads](https://camo.githubusercontent.com/8cf354d1650af9883f4309829e4081c0243f0976b69a687dc0470648d4b7842c/68747470733a2f2f706f7365722e707567782e6f72672f6a6a677261696e6765722f77702d6372756d62732f646f776e6c6f616473)](https://packagist.org/packages/jjgrainger/wp-crumbs) [![Latest Stable Version](https://camo.githubusercontent.com/df670bd7ad197dc6b160f39db930a8d68bd35bc93b77a3ba58d0c393ad208960/68747470733a2f2f706f7365722e707567782e6f72672f6a6a677261696e6765722f77702d6372756d62732f762f737461626c65)](https://packagist.org/packages/jjgrainger/wp-crumbs) [![License](https://camo.githubusercontent.com/1d6941955d17526b1ddae9610e6988f86428536d1777fd55890912d8891ab540/68747470733a2f2f706f7365722e707567782e6f72672f6a6a677261696e6765722f77702d6372756d62732f6c6963656e7365)](https://packagist.org/packages/jjgrainger/wp-crumbs)

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- [Composer](https://getcomposer.org/)
- [WordPress](https://wordpress.org) 5.3.2

Installation
------------

[](#installation)

```
$ composer require jjgrainger/wp-crumbs

```

Usage
-----

[](#usage)

#### Basic usage

[](#basic-usage)

Use `the_crumbs` to display the breadcrumbs in your template.

```
the_crumbs();
```

Options
-------

[](#options)

An optional array of arguments can be passed to modify the breadcrumb output. The defaults for each option are display below.

##### Example

[](#example)

```
the_crumbs( [
    'home'      => 'Home',   // Title for the Home (front page) link
    'blog'      => 'Blog',   // Title for the blog home page
    'seperator' => '/',      // Seperator to use between each crumb (string or false)
    'class'     => 'crumbs', // The class(es) applied to the wrapper element ('crumbs', 'nav crumbs')
    'element'   => 'nav'     // The HTML element to use (div, nav, ol, ul)
] );
```

##### Output

[](#output)

```

    Home
    /
    Blog
    /
    Single Post Title

```

Advanced usage
--------------

[](#advanced-usage)

#### get\_crumbs()

[](#get_crumbs)

Use `get_crumbs()` to retrieve an array of crumbs. Each crumb has a `title` and `url`.

##### Example

[](#example-1)

```
$breadcrumbs = get_crumbs();

print_r( $breadcrumbs );
```

##### Output

[](#output-1)

```
Array(
    [0] => Array(
        [title] => "Home"
        [url] => "http://site.com/"
    )
    [1] => Array(
        [title] => "Blog"
        [url] => "http://site.com/blog/"
    )
    [2] => Array(
        [title] => "My First Post"
        [url] => false
    )
)
```

You can modify the returned array and/or create a function to create an output of your choosing.

`get_crumbs` accepts the same aguments as `the_crumbs`.

#### Filters

[](#filters)

You can further modify the crumbs array using a filter on `get_crumbs`. This will also effect the output of `the_crumbs`.

##### Example

[](#example-2)

```
// Example: modify title for a custom post type
function modify_crumbs( $crumbs ) {
    // if on events archive change title to shows
    if ( is_post_type_archive( 'event' ) || is_singular( 'event' ) ) {
        for ( $i = 0; $i < count($crumbs); $i++ ) {
            if ( $crumbs[$i]['title'] === 'Events' ) {
                $crumbs[$i]['title'] = "Shows";
            }
        }
    }

    return $crumbs;
}

add_filter( 'get_crumbs', 'modify_crumbs' );
```

#### array\_insert()

[](#array_insert)

`array_insert()` is a function that allows you to insert a new element into an array at a specific index. [You can see a gist of it here](https://gist.github.com/jjgrainger/845271930a319079b74b).

when modifying the crumb trail you can add new crumbs at specific points.

##### Example

[](#example-3)

```
// Example: add post type archive on taxonomy archive page
function modify_crumbs( $crumbs ) {
    // if on the events category archive page
    if ( is_tax( 'event-categories' ) ) {
        // create a new crumb
        $crumb = [
            'title' => "Shows",
            'url'   => site_url( '/shows' ),
        ];

        // add the new crumb at the index of 1
        $crumbs = array_insert( $crumbs, $crumb, 1 );
    }

    return $crumbs;
}

add_filter( 'get_crumbs', 'modify_crumbs' );
```

Notes
-----

[](#notes)

- Licensed under the [MIT License](https://github.com/jjgrainger/wp-crumbs/blob/master/LICENSE)
- Maintained under the [Semantic Versioning Guide](http://semver.org)

Author
------

[](#author)

**Joe Grainger**

-
-

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Total

3

Last Release

4125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e75df324c03b826071d520965956f3bbb8353970080cdfb1c93a742ea0a4ee44?d=identicon)[jjgrainger](/maintainers/jjgrainger)

---

Top Contributors

[![jjgrainger](https://avatars.githubusercontent.com/u/904708?v=4)](https://github.com/jjgrainger "jjgrainger (17 commits)")[![webdevproformation](https://avatars.githubusercontent.com/u/25311422?v=4)](https://github.com/webdevproformation "webdevproformation (2 commits)")

---

Tags

breadcrumbswordpress

### Embed Badge

![Health badge](/badges/jjgrainger-wp-crumbs/health.svg)

```
[![Health](https://phpackages.com/badges/jjgrainger-wp-crumbs/health.svg)](https://phpackages.com/packages/jjgrainger-wp-crumbs)
```

###  Alternatives

[tzookb/tbmsg

users messaging system

10917.1k](/packages/tzookb-tbmsg)[cyber-duck/silverstripe-seo

A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content

4351.1k](/packages/cyber-duck-silverstripe-seo)[alexandresalome/assetic-extra-bundle

Extra feature for Assetic (asset directory)

1811.4k](/packages/alexandresalome-assetic-extra-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
