WordPress函数:comments_template(获取评论模板) 描述 加载评论模板。只能用于单篇 文章 或 页面 来显示评论,如果不是这些页面,将没办法显示。 用法 <?php comments_template( $file, $separate_comments ); ?> 参数 $file(字符串string) (可选) 要加载的文件 默认: /comments.php$separate_comments(布尔值boolean) (可选) 是… WordPress开发 13.3k 0 专业提供WordPress网站建设,主...
在WordPress中,要调用评论模板,可以使用comments_template()函数。这个函数用于加载主题中的评论模板文件,以显示文章或页面的评论区域。通常,你可以在单篇文章模板文件(例如single.php)或页面模板文件中使用这个函数。 以下是使用comments_template()函数的基本方法: ...
第1步:创建comments.php 创建一个新文件:comments.php。 把我的comments.txt文件中的内容复制到comments.php。 保存comments.php 文件。 第2步:样式化留言 把我的comments-template-css文件中的内容拷贝到你的style.css文件中。 复制到 style.css 的底部或者刚好#footer的上面。 第3步:在single.php添加留言模板 ...
get_search_form() 标签包含了当前使用主题的搜索框的模板文件: searchform.php ,如果没有该文件则使用系统生存默认的搜索框。 6、 comments_template():包含评论模板 用法: <?php comments_template(); ?> comments_template() 标签包含了当前使用主题的评论的模板文件 comments.php, 如果没有该文件则使用系统默...
模板标签(Template tags)在博客的 模板 文件中使用,用来动态的显示内容或自定义网站。下面介绍的是一些在WordPress中常用的标签,根据功能排序。 包含模板文件的标签(Include tags) get_header页头 get_sidebar侧栏 get_search_form搜索表单 comments_template评论模板。
<?php comments_template(); ?> comments_template()函数默认的就是加载主题文件夹下面的comments.php文件,这个函数也是可以带参数的,以便让你可以加载别的文件,比如某些页面你需要加载一个不一样的评论表单,你就需要使用comments_template()带上参数,这里不细说。
1回答 在comments WordPress中插入ACF自定义字段 、、、 我创建了一个短码,如下所示:comments_template(); add_shortcode('reacties','lijst_reacties'); 但它显示了我需要的所有内容,除了我需要在author名称后面添加一个自定义字段之外。自定义字段称为beroepsfunctie。我怎样才能在作者姓名后面插入这个? 浏览...
comments_template(); endif; 另一个Comments.php示例 以下是Twenty Thirteen主题中包含的comments.php模板的示例: <?php /** * 用于显示评论的模板。 * * 包含评论和评论表单的页面区域。 * * @package WordPress * @subpackage Twenty_Thirteen * @since Twenty Thirteen 1.0 ...
如果您创建了一个子主题,并且在添加代码段后在主页上没有看到评论,那么您可能需要添加额外的代码行。 如果是这种情况,请继续将以下代码复制并粘贴到主题的 index.php 文件中: global $withcomments;$withcomments = 1;comments_template(); // Get wp-comments.php template发布...
第1步:创建 comments.php创建一个新文件:comments.php。 把我的 comments.txt 文件中的内容复制到 comments.php。 保存comments.php 文件。第2步:样式化留言把我的 comments-template-css 文件中的内容拷贝到你的 style.css 文件中。 复制到 style.css 的底部或者刚好 #footer 的上面。