WordPress获取指定文章类型的文章列表链接:get_post_type_archive_link

WordPress函数get_post_type_archive_link用于获取指定文章类型的文章列表链接。

get_post_type_archive_link( string $post_type )

函数参数

$post_type

字符串

文章类型

函数使用示例

<a href="<?php echo get_post_type_archive_link( 'books' ); ?>">图书列表</a>

扩展阅读

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

相关函数:

  • get_home_url()
  • home_url()
  • post_type_archive_link()
  • get_permalink()
  • user_trailingslashit()
阿里云