the_permalink

Sponsored Link

現在ループ内で処理される記事のパーマリンクのURLを表示します。
このタグはループ内でなければならず、一般的に記事が表示されている時に各記事のパーマリンクを表示するために使用します。独自の記事IDを指定して、記事にパーマリンクを表示したい場合は、get_permalink()を参照してください。

Sponsored Link

Displays the URL for the permalink to the post currently being processed in The Loop. This tag must be within The Loop, and is generally used to display the permalink for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your weblog. Refer to get_permalink() if you want to display the permalink for a post, given its unique post id.

the_permalinkのテンプレートタグ使用方法

<?php the_permalink(); ?> 

the_permalinkのパラメーター

このタグにはパラメーターがありません。

This tag has no parameters.

テキストとして投稿のURLを表示する方法

リンクを作成せずに、記事のURLを表示します:

Displays the URL to the post, without creating a link:

This address for this post is:<?php the_permalink(); ?>

テキストとリンクとして

“permalink”の例で、リンクテキストとして適するテキストは何でも使用する事が出来ます。

You can use whatever text you like as the link text, in this case, “permalink”.

<a href="<?php the_permalink(); ?>">permalink</a>

タイトルタグをリンクとして使用する方法

リンクテキストとして記事タイトルと共に、パーマリンクへのリンクを作成します。これは記事タイトルを入れるための一般的な方法です。

Creates a link for the permalink, with the post’s title as the link text. This is a common way to put the post’s title.

<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

変更ログ

Since: 1.2.0

ソースファイル

the_permalink()は、wp-includes/link-template.php内に位置しています。

the_permalink() is located in wp-includes/link-template.php.

関連テンプレートタグ

get_permalink, the_permalink, post_permalink, permalink_anchor, permalink_single_rss

Sponsored Link