Download the PHP package jjgrainger/wp-crumbs without Composer
On this page you can find all versions of the php package jjgrainger/wp-crumbs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jjgrainger/wp-crumbs
More information about jjgrainger/wp-crumbs
Files in jjgrainger/wp-crumbs
Package wp-crumbs
Short Description Simple Wordpress Breadcrumbs.
License MIT
Homepage https://github.com/jjgrainger/wp-crumbs
Informations about the package wp-crumbs
WP Crumbs v1.0.2
Simple Wordpress Breadcrumbs
Requirements
Installation
Usage
Basic usage
Use the_crumbs
to display the breadcrumbs in your template.
Options
An optional array of arguments can be passed to modify the breadcrumb output. The defaults for each option are display below.
Example
Output
Advanced usage
get_crumbs()
Use get_crumbs()
to retrieve an array of crumbs. Each crumb has a title
and url
.
Example
Output
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
You can further modify the crumbs array using a filter on get_crumbs
. This will also effect the output of the_crumbs
.
Example
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.
when modifying the crumb trail you can add new crumbs at specific points.
Example
Notes
- Licensed under the MIT License
- Maintained under the Semantic Versioning Guide
Author
Joe Grainger