Linux 软件免费装

Smarter Navigation

开发者 scribu
versusbassz
更新时间 2015年9月19日 06:24
PHP版本: 3.2 及以上
WordPress版本: 3.5
版权: GPLv2 or later
版权网址: 版权信息

标签

navigation referrer next previous

下载

1.1.2 1.2.1 1.3.1 1.3.2 1.4

详情介绍:

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 | Author's Site

安装:

  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 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.

常见问题:

"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);

更新日志:

1.4 1.3.2 1.3.1 1.3 1.2.1 1.2 1.1.2 1.1.1 1.1 1.0