Skip to content

wp面包屑路径

2009 四月 25
by 荒野无灯

http://mtekk.weblogs.us/code/breadcrumb-navxt/

Breadcrumb NavXT
Breadcrumb NavXT, the successor to the popular WordPress plugin Breadcrumb Navigation XT, was written from the ground up to be better than its ancestor.

Table of Contents
Purpose
Download
Installation
Basic Usage
Advanced Usage
Version History and Changelog
License
Purpose
Breadcrumb NavXT is a WordPress plugin compatible with WordPress versions 2.5 and up. This plugin generates locational breadcrumb trails for your WordPress blog. These represent the hierarchy leading up to the current page rather than the actual path taken to arrive at the current page. Breadcrumb trails are a good supplementary navigation system that aid in site usability. To the right are examples of breadcrumb trails generated by this plugin.

Download
Latest Stable Release: Breadcrumb NavXT 3.1.0

Latest Testing Release: Breadcrumb NavXT SVN Trunk

Installation
Download the plugin zip archive, see Download section.
Disable any previous version of this plugin or Breadcrumb Navigation XT.
Extract the contents of the zip archive into your plugins folder (wp-content/plugins).
Enabling the plugin:
If the Administration interface is desired, enable the Breadcrumb NavXT – Administration plugin in the administration panel under the Plugins section.
If the Administration interface is not desired, enable the Breadcrumb NavXT – Core plugin.
Note: Do not have both plugins enabled at the same time.

Continue onto the Basic Usage section, or follow instructions given by your theme (if applicable).
Basic Usage
Depending on your theme this section may be unnecessary. If you are using berry as your theme everything is done for you so you have no further steps to take. If you are a theme developer skip ahead to Advanced Usage and the full documentation. Otherwise keep reading. Open the appropriate file for your theme (typically header.php). This can be done within WordPress’ administration panel through Presentation > Theme Editor or through your favorite text editor.

1
2
3
4
5
6
7
8
<div class="breadcrumb">
<?php
if(function_exists('bcn_display'))
{
    bcn_display();
}
?>
</div>

Save the file (upload if applicable). Now you should have a breadcrumb trail on your blog where ever this code was placed. To customize the breadcrumb trail you may edit the default values for the options in the administrative interface. This is located in your administration panel under Settings > Breadcrumb NavXT.

Advanced Usage
The Basic Usage section only covers the use of the administration panel. Using the administration panel method makes a trade off of speed for ease of use–many of the speed issues present in previous versions are addressed in version 3.0.0. Enable the Breadcrumb NavXT – Core plug-in instead of the Breadcrumb NavXT – Administration plugin. When not using the administration interface, use the following code to generate breadcrumbs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<div class="breadcrumb">
<?php
if(class_exists('bcn_breadcrumb_trail'))
{
    //Make new breadcrumb object
    $breadcrumb_trail = new bcn_breadcrumb_trail;
    //Setup options here if needed
    //Fill the breadcrumb trail
    $breadcrumb_trail->fill();
    //Display the trail
    $breadcrumb_trail->display();
}
?>
</div>

Examples on some advanced usage situations are available in the Documentation.

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=1755

3 Responses Post a comment
  1. 三月 4, 2011

    万戈最近也出了个实现面包屑导航的非插件方法。

  2. 五月 18, 2010

    :evil: 晕啊,究竟是要表达什么功能呢?

    • 五月 18, 2010

      就是一个显示面包屑路径的插件,当时没时间,就直接COPY文章过来了,玩代码的人一看就知道的。

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS