Castlegate IT WP Breadcrumb
Simple breadcrumb navigation for WordPress
by Castlegate IT · github.com/castlegateit/cgit-wp-breadcrumb · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/castlegateit/cgit-wp-breadcrumb/archive/refs/heads/master.zipDeclares an update source (https://github.com/castlegateit/cgit-wp-breadcrumb), so updates arrive through the plugin's own updater.
Readme
Castlegate IT WP Breadcrumb
Castlegate IT WP Breadcrumb adds a simple breadcrumb navigation to WordPress. The Castlegate\Breadcrumb\Breadcrumb class can generate breadcrumb items as an array of data, an array of HTML links, or a complete breadcrumb navigation:
use Castlegate\Breadcrumb\Breadcrumb;
$crumb = new Breadcrumb();
$foo = $crumb->getItems(); // return array of items
$foo = $crumb->getLinks(); // return array of HTML links
$foo = $crumb->render($sep); // return HTML links separated by $sep
$foo = $crumb->renderList($tag); // return HTML list
Default text for front page and posts page
You can specify the text used for the home page and the posts index in the constructor:
$crumb = new Breadcrumb([
'home' => 'Home',
'index' => 'News',
]);
You can also use the cgit_breadcrumb_names filter to edit the array of front and posts page names.
Custom HTML
You can customize the HTML used for links, non-links, and the current breadcrumb item using a filter, with sprintf strings as templates:
add_filter('cgit_breadcrumb_templates', function ($templates) {
'url' => '<a href="%2$s" class="cgit-breadcrumb-item link">%1$s</a>',
'current' => '<span class="cgit-breadcrumb-item current">%s</span>',
'span' => '<span class="cgit-breadcrumb-item span">%s</span>',
});
Functions
For backwards compatibility, the plugin also provides a function for rendering a breadcrumb navigation, equivalent to the render method:
$foo = cgit_breadcrumb($sep, $home, $index);
License
Released under the MIT License. See LICENSE for details.
Read the full README on GitHub →
Releases
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.