您的当前位置:首页 > 知识博客 > wordpress建站

WordPress文章添加锚标签:permalink_anchor

时间:2024-03-15

WordPress模板标签permalink_anchor输出一个ID为post-ID的空链接,通常用于跳转页面到特定位置,需要用在The Loop主循环中。

permalink_anchor( string $mode = 'id' )

函数参数

$mode

字符串值,默认值:id

可选的值:

  • id:空链接的ID值为post-ID,其中ID为文章的ID

  • title:空链接的ID值为文章别名

函数使用示例

<h3><?php permalink_anchor(); ?><?php the_title(); ?></h3>

扩展阅读

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

相关函数:

  • get_permalink()

  • the_permalink()

  • post_permalink()

  • permalink_single_rss()


欢迎咨询/Welcome to inquire
tel/vx:18842938855
qq:1685522781
email:1685522781@qq.com

Copyright © 2019-2024 58.bj.cn


Whatsapp
Powered by RRZCMS