admin管理员组文章数量:1122846
I apologise deeply if this topic already been answered here in the past. I have searched for an answer and couldn't find.
The question is regarding Gutenberg, FSE editor, block theme: is it possible to customize the Query Loop to allow to order by comments number, and post visualization number? If yes, how can I do that? (right now using twenty twenty four theme).
Thank you.
I apologise deeply if this topic already been answered here in the past. I have searched for an answer and couldn't find.
The question is regarding Gutenberg, FSE editor, block theme: is it possible to customize the Query Loop to allow to order by comments number, and post visualization number? If yes, how can I do that? (right now using twenty twenty four theme).
Thank you.
Share Improve this question edited May 10, 2024 at 3:18 neoswf asked May 7, 2024 at 0:23 neoswfneoswf 1256 bronze badges 2- What do you mean by "post visualization number" please? – Wongjn Commented May 7, 2024 at 7:15
- @Wongjn - I meant views number per post, but ill be fine with ordering by comments number. Any idea how can I achieve that, add this functionality to the query loop? (have edited the question) – neoswf Commented May 10, 2024 at 3:17
1 Answer
Reset to default 0You could change the query.orderBy
parameter of the query block (as long as query.inherit
is not true
). This parameter corresponds to the orderby
query var. For number of comments, you'd use the comments_count
value, as per the `WP_Query::parse_query documentation.
To add this value, you'd need to be in the code editor (not visual editor) of the block editor and have these as in the block comment opener for the core/query
block:
<!-- wp:query {"query":{ … "orderBy":"comment_count", … "inherit":false}, … } -->
本文标签: How to make FSE39s query loop to order by comments number
版权声明:本文标题:How to make FSE's query loop to order by comments number? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736307620a1933377.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论