PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > CMS教程 > wordpress教程 > 正文

    wordpress评论标签comments_template 的使用

    作者:w634381967来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:comments_template标签是方便我们在wordpress网站中调用评论文件comments.php的,如果在主题当中没有comments.php文件,标签会自动获取程序路...
    comments_template标签是方便我们在wordpress网站中调用评论文件comments.php的,如果在主题当中没有comments.php文件,标签会自动获取程序路径wp-includes/theme-compat/comments.php的默认评论模块,在模板制作中我们使用以下标签进行调用:

    <?php comments_template( $file, $separate_comments ); ?>

    其中的$file参数是指可以导入不同的评论文件的,例如:我们在主题中创建一个 comments-other.php 文件,我们可以通过以下代码进行调用:

    <?php comments_template( '/comments-other.php' ); ?>  

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-103-1308-1.html
    相关热词搜索: