admin管理员组文章数量:1302333
I use ACF Pro to create a customized comments section with additional fields to my custom post type called Products (it's a simple page with a custom comment section, NOT using WooCommerce).
Now visitors to the website can comment by adding a place where you can buy the product. You can add an image, name, price, link, and country for each product, and it works great.
How it looks, (please ignre the random data inside, just for testing purpose):
What I want is to be able to sort or filter those comments, by adding a select form with options that will make users able to sort the comments by the country field. If they select the UK option in select form, then the first comments should be the ones containing 'UK' in the country field.
Can anybody help me with this?
Much appreciated!
I use ACF Pro to create a customized comments section with additional fields to my custom post type called Products (it's a simple page with a custom comment section, NOT using WooCommerce).
Now visitors to the website can comment by adding a place where you can buy the product. You can add an image, name, price, link, and country for each product, and it works great.
How it looks, (please ignre the random data inside, just for testing purpose): https://ibb.co/zh0rWf9
What I want is to be able to sort or filter those comments, by adding a select form with options that will make users able to sort the comments by the country field. If they select the UK option in select form, then the first comments should be the ones containing 'UK' in the country field.
Can anybody help me with this?
Much appreciated!
Share Improve this question edited Mar 11, 2021 at 20:44 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Mar 11, 2021 at 20:15 AleksandarAleksandar 1 1- Welcome to the WordPress DEvelopment Stack exchange. We focus on WordPress development here rather than the support of third-party plugins. You might find better help on the AFC Pro support page. If you have not done so yet, consider checking out the tour and help center to find out how things work here. – Matthew Brown aka Lord Matt Commented Mar 13, 2021 at 9:53
1 Answer
Reset to default 0I would use an url parameter to define which products are shown, and update the page contents either by javascript or php.
本文标签: Custom sort comments with select form
版权声明:本文标题:Custom sort comments with select form 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741686855a2392491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论