不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

WordPress next_post_link()函数

next_post_link()函数介绍

  1. 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”。
    1. function next_post_link( $format = ‘%link »’, $link = ‘%title’, $in_same_term = false, $excluded_terms = ”, $taxonomy = ‘category’ ) {
    2. echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
    3. }
  • 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()函数使用示例

    1. <?php next_post_link(); ?>
  • <?php next_post_link(); ?>
    1. <?php next_post_link(‘%link’, ‘%title’); ?>
  • <?php next_post_link(‘%link’, ‘%title’); ?>
    1. <?php next_post_link( ‘<strong>%link</strong>’ ); ?>
  • <?php next_post_link( ‘<strong>%link</strong>’ ); ?>
    1. <?php next_post_link( ‘%link’, 分类中的下一篇文章, TRUE, ’13’ ); ?>
  • <?php next_post_link( ‘%link’, 分类中的下一篇文章, TRUE, ’13’ ); ?>
    1. <?php next_post_link(‘%link’,‘%title’, TRUE,”, category); ?>
  • <?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘category’); ?>
    1. <?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘wenda’); ?>
  • <?php next_post_link(‘%link’,‘%title’, TRUE,”, ‘wenda’); ?>
  • 赞(0)
    未经允许不得转载:seo优化_前端开发_渗透技术 » WordPress next_post_link()函数