the_permalink()

WordPress模板函数the_permalink用于输出文章的固定链接,即伪静态形式的链接地址,需要用在The Loop主循环中。

the_permalink( $post = 0 )

该函数没有参数,事实上the_permalink()函数相当于调用了get_permalink( $post ),将当前文章对象传递给了get_permalink()函数并输出返回的结果。

函数使用示例

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

扩展阅读

the_permalink()函数位于:wp-includes/link-template.php

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索