admin管理员组文章数量:1122846
I am using WordPress 6+ with a full-site editor theme.
I need to add the post slug as the id for each post in the query loop block.
Must I extend the block for such a trivial task?
I am using WordPress 6+ with a full-site editor theme.
I need to add the post slug as the id for each post in the query loop block.
Must I extend the block for such a trivial task?
Share Improve this question asked Jan 8, 2024 at 19:47 Mike RitterMike Ritter 494 bronze badges 2- I don't see any way to do it in the UI. Can I ask why you need it? – Jacob Peattie Commented Jan 11, 2024 at 16:23
- 1 I want to be able to add internal links so I don’t have to link to the page and then someone scroll down to the block. – Mike Ritter Commented Jan 12, 2024 at 22:47
1 Answer
Reset to default 1I spent ages looking for this, then discovered that the otter blocks plugin (it was installed with my theme but it's a free plugin) allows the use of dynamic values in any block. I don't think the post-slug as an option but I used the post-id. I swapped to the code editor to add an id to the group div containing post details (ie inside the query block): id="{otterDynamic?type=postID&context=query}" and it works great. Unfortunately The documentation of this in otter blocks is hard to find! https://docs.themeisle.com/article/1736-how-to-add-magic-tags-to-display-dynamic-values
本文标签: full site editingHow do I add unique id values to query loop block post template tags
版权声明:本文标题:full site editing - How do I add unique id values to query loop block post template tags? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736293857a1929232.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论