web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. AIGC工具
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站
    手机应用

wordpress如何获取下个评论的链接

580 ℃

函数原型:

get_next_comments_link( string $label = '', int $max_page ): string|void

//$label,链接文本的标签。默认值:“”。
//$max_page,最大页面。

函数源码:

function get_next_comments_link( $label = '', $max_page = 0 ) {
  global $wp_query;
  if ( ! is_singular() ) {
    return;
  }

  $page = get_query_var( 'cpage' );

  if ( ! $page ) {
    $page = 1;
  }

  $next_page = (int) $page + 1;

  if ( empty( $max_page ) ) {
    $max_page = $wp_query->max_num_comment_pages;
  }

  if ( empty( $max_page ) ) {
    $max_page = get_comment_pages_count();
  }

  if ( $next_page > $max_page ) {
    return;
  }

  if ( empty( $label ) ) {
    $label = __( 'Newer Comments »' );
  }

  $attr = apply_filters( 'next_comments_link_attributes', '' );

  return sprintf(
    '<a href="%1$s" %2$s>%3$s</a>',
    esc_url( get_comments_pagenum_link( $next_page, $max_page ) ),
    $attr,
    preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&#038;$1', $label )
  );
}

WordPress评论相关功能介绍

WordPress如何显示当前文章的评论个数

wordpress如何显示下个评论链接

wordpress技巧如何显示当前评论的摘要

wordpress技巧如何显示当前评论的日期

标签: get_next_comments_link, wordpress评论

上面是“wordpress如何获取下个评论的链接”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_4850.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > wordpress
本文共计718个字,预计阅读时长5分钟

基金从业资格考试题库

一站式备考基金从业资格考试,收录2021-2025年模拟题库!呱呱工具箱

AI工作站

收录全球3800+ 款各行各业AI应用,轻轻松松做事!
生活小工具,收录了80多款小工具
上一篇: 推荐一款免费可商用英文字体——Atkinson Hyperlegible
下一篇: 推荐一款免费好看的中文设计字体——字体传奇特战体
x 打工人ai神器