next_post_link()函数介绍
- next_post_link( string $format = ‘%link »’, string $link = ‘%title’, bool $in_same_term = false, array|string $excluded_terms = ”, string $taxonomy = ‘category’ )
next_post_link( string $format = ‘%link »’, string $link = ‘%title’, bool $in_same_term = false, array|string $excluded_terms = ”, string $taxonomy = ‘category’ )
- $format(字符串):(可选)链接锚点格式,默认为“« %link”,默认值:“%link »”。
- $link(字符串):(可选)链接永久链接格式,默认的“%title”,默认值:“%title”。
- $in_same_term(布尔型):(可选)链接是否应使用相同的分类术语,默认值:false。
- $excluded_terms(数组|字符串):(可选)以数组或逗号分隔的排除项 ID 列表,默认值:”。
- $taxonomy(字符串):(可选)分类法,如果$in_same_term 为 true,默认值:“category”。
$format(字符串):(可选)链接锚点格式,默认为“« %link”,默认值:“%link »”。
$link(字符串):(可选)链接永久链接格式,默认的“%title”,默认值:“%title”。
$in_same_term(布尔型):(可选)链接是否应使用相同的分类术语,默认值:false。
$excluded_terms(数组|字符串):(可选)以数组或逗号分隔的排除项 ID 列表,默认值:”。
$taxonomy(字符串):(可选)分类法,如果$in_same_term 为 true,默认值:“category”。
- function next_post_link( $format = ‘%link »’, $link = ‘%title’, $in_same_term = false, $excluded_terms = ”, $taxonomy = ‘category’ ) {
- echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
- }
function next_post_link( $format = ‘%link »’, $link = ‘%title’, $in_same_term = false, $excluded_terms = ”, $taxonomy = ‘category’ ) {
echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
}
next_post_link()函数使用示例
- <?php next_post_link(); ?>
<?php next_post_link(); ?>
- <?php next_post_link(‘%link’, ‘%title’); ?>
<?php next_post_link(‘%link’, ‘%title’); ?>
- <?php next_post_link( ‘<strong>%link</strong>’ ); ?>
<?php next_post_link( ‘<strong>%link</strong>’ ); ?>
- <?php next_post_link( ‘%link’, 分类中的下一篇文章, TRUE, ’13’ ); ?>
<?php next_post_link( ‘%link’, 分类中的下一篇文章, TRUE, ’13’ ); ?>
- <?php next_post_link(‘%link’,‘%title’, TRUE,”, category); ?>
<?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘category’); ?>
- <?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘wenda’); ?>
<?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘wenda’); ?>