wordpress - 在现有的 wordpress 主题中添加客户评论页面
问题描述
我正在用 Wordpress 开发一个网页。我的主题没有客户评论页面。所以我想手动添加一个页面来显示客户评论。它应该像这样工作,客户可以通过提供他的姓名和邮件来撰写评论,然后是实际评论,然后他可以提交。一旦他提交了评论,评论就必须显示在评论页面中。我需要一些帮助或任何有关我可以执行此操作的相关插件的建议。
解决方案
您可以使用自定义帖子类型。创建名为“客户评论”的自定义帖子类型。您可以使用https://wordpress.org/plugins/custom-post-type-ui/插件创建它。
之后,您需要创建存档-您的自定义 posttype slug(例如 archive-customer_review.php)页面并获取自定义 posttype 数据,如下所示:
<?php
$args = array(
'post_type'=> 'services',
'areas' => 'painting',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();
?>
推荐阅读
- github - 从远程存储库中提取而不更改更新的本地文件
- python-3.x - 从 mongodb 集合中查找特定值
- shell - 不可打印的字符未被识别为字段分隔符
- amazon-web-services - 开发 AWS Lambda 函数时要在 API Gateway 代理请求事件中使用哪些属性?
- python-3.x - 在跟踪这个与 python 迭代器和生成器有关的函数时需要帮助
- google-app-engine - 如何将系统环境变量传递给 app.yaml?
- powershell - 从输入文件中为用户导出会员组
- git - 我该如何理解这个 git rebase --onto 示例?
- html - HTML 幻灯片无法正常工作
- javascript - 制表符表格无法正确查看