首页 > 解决方案 > 在现有的 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(); 
?> 

推荐阅读