이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

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

FAQ

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

후기

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 평가 읽기

기여자 & 개발자

“Smarter Navigation”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Smarter Navigation”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

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

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

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

1.0