這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Carbon Breadcrumbs

外掛說明

Provides the theme and plugin developers an easy way to build and implement highly customizable breadcrumb functionality, specifically tailored to their needs.
Supports a lot of filters and hooks, and is written in OOP style, giving developers full control over the breadcrumb trail items and appearance.
This plugin can also be embedded in themes, instead of installing it as a WordPress plugin.

Configuration

The most basic way to insert Carbon Breadcrumbs in your theme code is:

<?php Carbon_Breadcrumb_Trail::output(); ?>

If you want to specify various breadcrumb rendering options, you can specify them in an array, like this:

<?php
Carbon_Breadcrumb_Trail::output(array(
    'glue' => ' &gt; ', // glue between breadcrumb items
    'link_before' => '',
    'link_after' => '',
    'wrapper_before' => '',
    'wrapper_after' => '',
    'title_before' => '',
    'title_after' => '',
    'min_items' => 2,
    'last_item_link' => true,
    'display_home_item' => true,
    'home_item_title' => __('Home', 'carbon_breadcrumbs'),
    'renderer' => 'Carbon_Breadcrumb_Trail_Renderer',
));
?>

For additional configuration and developer documentation, you can visit the Github repository:

https://github.com/tyxla/carbon-breadcrumbs

Ideas and bug reports

Any ideas for new modules or any other additional functionality that users would benefit from are welcome.

If you have an idea for a new feature, or you want to report a bug, feel free to do it here in the Support tab, or you can do it at the Github repository of the project:

https://github.com/tyxla/carbon-breadcrumbs

安裝方式

  1. Install Carbon Breadcrumbs either via the WordPress.org plugin directory, or by uploading the files to your server.
  2. Activate the plugin.
  3. That’s it. You’re ready to go! Please, refer to the Configuration section for examples and usage information.

使用者評論

2017 年 10 月 17 日
GREAT plugin, fantastic codebase: super clean & TESTED?! FTW! Only downside is no schematagging out of the box :/. This is a pivotal SEO feature and I think this would greatly boost interest in your plugin. Info: https://developers.google.com/search/docs/data-types/breadcrumbs#guidelines Result should look like: <ol itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemscope itemtype="http://schema.org/WebPage" itemprop="item" href="link.html"> <span itemprop="name">Crumb 1</span> </a> <meta itemprop="position" content="1" /> / </li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a itemscope itemtype="http://schema.org/WebPage" itemprop="item" href="link2.html"> <span itemprop="name">Crumb 2</span> </a> <meta itemprop="position" content="2" /> </li> </ol> Here's how I've shimmed it in: <?php $breadcrumbs = new Carbon_Breadcrumb_Trail(array( 'glue' => ' / ', 'link_before' => '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">', 'link_after' => '</li>', 'wrapper_before' => '<ol class="breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">', 'wrapper_after' => '</ol>', 'title_before' => '<span itemprop="name">', 'title_after' => '</span>', )); $breadcrumbs->setup(); echo $breadcrumbs->render(true); // WP_KSES strips itemprop, itemscope, etc, so bypassing!!! add_filter('carbon_breadcrumbs_item_attributes', _'breadcrumb_schematags', 10, 2); function breadcrumb_schematags($attributes, $item) { if (!is_array($attributes)) $attributes = array(); $attributes['itemscope'] = null; $attributes['itemtype'] = 'http://schema.org/WebPage'; $attributes['itemprop'] = 'item'; return $attributes; } add_filter('carbon_breadcrumbs_item_output', 'breadcrumb_item_position', 10, 5); function breadcrumb_item_position($item_output, $item, $trail, $trail_renderer, $index){ // Add Position $n = strrpos($item_output, '</li>'); $item_output = substr($item_output, 0, $n) . '<meta itemprop="position" content="'. $index .'" />' . substr($item_output, $n); return $item_output; }
閱讀全部 4 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Carbon Breadcrumbs〉的開發相關工作。

參與者

將〈Carbon Breadcrumbs〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.2

Tested with WordPress 4.5.

1.0.1

Add some .gitattributes to make exporting lighter.

1.0

Initial version.