Title: Smarter Navigation
Author: scribu
Published: <strong>2009 年 2 月 18 日</strong>
Last modified: 2015 年 9 月 18 日

---

搜尋外掛

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

![](https://s.w.org/plugins/geopattern-icon/smarter-navigation.svg)

# Smarter Navigation

 由 [scribu](https://profiles.wordpress.org/scribu/) 開發

[下載](https://downloads.wordpress.org/plugin/smarter-navigation.1.4.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/smarter-navigation/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/smarter-navigation/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/smarter-navigation/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/smarter-navigation/#developers)

 [技術支援](https://wordpress.org/support/plugin/smarter-navigation/)

## 外掛說明

When displaying a single post, you might want to show links to the previous and 
next posts in the same category.

That’s fine; WordPress let’s you do this with `previous_post_link()` and `next_post_link()`.

But what if that post is in multiple categories?

What if the user came to that post from a tag page or from an author page? Wouldn’t
it make more sense to display previous / next posts from that particular set?

Well, you can do this with a similar pair of functions, provided by this plugin:`
previous_post_smart()` and `next_post_smart()`.

Here’s how it works:

Whenever a visitor goes to an archive page (category, tag, date, author, search 
etc.), the plugin notes which archive it is in a browser cookie.

Then, if the visitor goes to a single post from that archive page, the plugin generates
the prev / next links based on the information in the cookie.

Links: [Plugin News](http://scribu.net/wordpress/smarter-navigation) | [Author’s Site](http://scribu.net)

## 安裝方式

 1. Unzip the archive and put the folder into your plugins folder (/wp-content/plugins/).
 2. Activate the plugin from the Plugins admin menu.

#### Basic usage

Go to your theme directory and open single.php.

Replace

    ```
    previous_post_link( with `previous_post_smart(` 
    ```

and

    ```
    next_post_link( with `next_post_smart(`
    ```

#### Referrer link

If you also want to display a link back to the list of posts, add this line (also
in single.php):

    ```
    <?php referrer_link(); ?>
    ```

#### Posts with multiple categories

If you want for example to [higlight the category](https://wordpress.org/support/topic/366588)
that the user came from, you can use `get_referrer_category()` to retrieve the category
object.

For further reference, all the template tags are located in [smarter-navigation/template-tags.php](https://plugins.trac.wordpress.org/browser/smarter-navigation/trunk/template-tags.php).

## 常見問題集

  “Parse error: syntax error, unexpected…” Help!

Make sure your host is running PHP 5. Add this line to wp-config.php to check:

    ```
    var_dump(PHP_VERSION);
    ```

## 使用者評論

![](https://secure.gravatar.com/avatar/e28ff0defed3e7542014233b151cb43f0870a92c34bcdb6d45cca86339ed4f1b?
s=60&d=retro&r=g)

### 󠀁[Worked like a charm](https://wordpress.org/support/topic/worked-like-a-charm-87/)󠁿

 [Munir Kamal](https://profiles.wordpress.org/munirkamal/) 2016 年 9 月 3 日

I have been looking into code this functionality myself but have been not able to
make it work properly than i came across this plugin and it worked liked a charm
on just installing it.

 [ 閱讀全部 10 則使用者評論 ](https://wordpress.org/support/plugin/smarter-navigation/reviews/)

## 參與者及開發者

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

參與者

 *   [ scribu ](https://profiles.wordpress.org/scribu/)
 *   [ versusbassz ](https://profiles.wordpress.org/versusbassz/)

[將〈Smarter Navigation〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/smarter-navigation)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/smarter-navigation/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/smarter-navigation/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/smarter-navigation/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/smarter-navigation/)。

## 變更記錄

#### 1.4

 * added support for custom taxonomies. props badfeather
 * fixed strict standards errors. props badfeather

#### 1.3.2

 * fix case when plugin worked incorrect with pagination

#### 1.3.1

 * fix case when multiple browser tabs are involved
 * fix case when multiple posts have the exact same date

#### 1.3

 * store query vars in cookie instead of individual post ids
 * fix referer link
 * [more info](http://scribu.net/wordpress/smarter-navigation/sn-1-3.html)

#### 1.2.1

 * enable $in_same_cat by default

#### 1.2

 * moved to PHP5 syntax
 * added get_referrer_category() and get_referrer_url() template tags
 * added $in_same_cat and $excluded_categories arguments to previous_post_smart()&
   next_post_smart()
 * [more info](http://scribu.net/wordpress/smarter-navigation/sn-1-2.html)

#### 1.1.2

 * added $fallback parameter to *_post_smart()

#### 1.1.1

 * better SQL limit

#### 1.1

 * handles posts split on multiple pages
 * better behaviour when multiple tabs open
 * [more info](http://scribu.net/wordpress/smarter-navigation/sn-1-1.html)

#### 1.0

 * initial release
 * [more info](http://scribu.net/wordpress/smarter-navigation/sn-1-0.html)

## 中繼資料

 *  版本 **1.4**
 *  最後更新 **11 年前**
 *  啟用安裝數 **300+**
 *  WordPress 版本需求 ** 3.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.5.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/smarter-navigation/)
 * 標籤:
 * [navigation](https://tw.wordpress.org/plugins/tags/navigation/)[next](https://tw.wordpress.org/plugins/tags/next/)
   [previous](https://tw.wordpress.org/plugins/tags/previous/)[referrer](https://tw.wordpress.org/plugins/tags/referrer/)
 *  [進階檢視](https://tw.wordpress.org/plugins/smarter-navigation/advanced/)

## 評分

 4.7 星，滿分為 5 星

 *  [  9 個 5 星使用者評論     ](https://wordpress.org/support/plugin/smarter-navigation/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/smarter-navigation/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/smarter-navigation/reviews/?filter=3)
 *  [  1 個 2 星使用者評論     ](https://wordpress.org/support/plugin/smarter-navigation/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/smarter-navigation/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/smarter-navigation/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/smarter-navigation/reviews/)

## 參與者

 *   [ scribu ](https://profiles.wordpress.org/scribu/)
 *   [ versusbassz ](https://profiles.wordpress.org/versusbassz/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/smarter-navigation/)