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

Permalink Shortcode

설명

Permalink Shortcode is a relatively simple plugin that implements a shortcode that you can use to link to existing posts and pages on your site. The shortcode also supports a number of HTML attributes (see below).

While WordPress does include a feature that allows you to link to existing content, this feature only inserts a “static” link. If you were to change the slug for that post or page, previously inserted links would no longer be valid.

The permalink shortcode can be used in two forms:

  1. Standard: <a href="[permalink wpid='123']">link text</a>
  2. Enclosing: [permalink wpid="123"]link text[/permalink]

(Note the single quotes used in the standard form example above. Using double quotes in this situation will not work.)

Supported Attributes

The following attributes are available in both the shortcode’s standard form and its enclosing form:

  • wpid: The ID number of the post or page to which you want a link.
  • query: The part of a URL that comes after the ‘?’ (e.g. “?foo=bar”). The ‘?’ is optional and will be added automatically if not included.
  • fragment: The part of the URL that comes after the ‘#’ (e.g. “#comments”). The ‘#’ is optional and will be added automatically if not included.

The following HTML attributes are available only in the shortcode’s enclosing form:

  • accesskey
  • charset
  • class
  • dir
  • hreflang
  • id
  • lang
  • media
  • rel
  • rev
  • style
  • target
  • title
  • type

Things to be aware of with some of the above attributes:

  • In the enclosing form, the CSS class name permalink-shortcode is always added to the class attribute, even if you don’t specify any class names yourself.
  • In the enclosing form, if no value is given for the title attribute, the post or page title will be used.

Usage Examples

Simple link (standard form):

<a href="[permalink wpid='123']">link text</a>

Result:

<a href="http://www.example.com/hello-world/">link text</a>

Simple link (enclosing form):

[permalink wpid="123"]link text[/permalink]

Result:

<a href="http://www.example.com/hello-world/" class="permalink-shortcode" title="Hello, world!">link text</a>

Linking to the Comments section of a post (standard form):

<a href="[permalink wpid='123']#comments">link text</a>

…or…

<a href="[permalink wpid='123' fragment='comments']">link text</a>

Result:

<a href="http://www.example.com/hello-world/#comments">link text</a>

Adding a custom CSS class and title (enclosing form):

[permalink wpid="123" class="my-class" title="Some Other Page"]link text[/permalink]

Result:

<a href="http://www.example.com/hello-world/" class="permalink-shortcode my-class" title="Some Other Page">link text</a>

설치

  1. Unzip the downloaded .zip file.
  2. Upload the permalink-shortcode folder to your /wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

How do I find the ID of the post or page?

The ID for a post or page can be found in just about any Edit link for that content. All you need to do is hover your mouse over the link and look at the tooltip that displays the URL (where this appears depends on the browser you’re using). An example:

http://www.example.com/wp-admin/post.php?post=123&action=edit

In the above example, 123 is the ID of the post. This is the number you want to use for the shortcode’s wpid attribute, like so:

[permalink wpid="123"]

후기

2018년 4월 10일
Taken me half an hour to find this gem. I can add links to drafts too. If only it worked with media too.
모든 4 평가 읽기

기여자 & 개발자

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

기여자

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

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

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

변경이력

1.0.0

  • Initial release.