admin管理员组文章数量:1296291
I am really not sure how to write the code. How do I get all the headings from the page? To be specific, core/heading
. I wanted to make a sidebar so that the user can just jump from one section to another. Please see the image below.
I am really not sure how to write the code. How do I get all the headings from the page? To be specific, core/heading
. I wanted to make a sidebar so that the user can just jump from one section to another. Please see the image below.
- 1 You mean an outliner or table of contents? Such a block already exists in Gutenberg as part of the full site editing initiative, you can see its source code here github/WordPress/gutenberg/tree/trunk/packages/… – Tom J Nowell ♦ Commented Apr 5, 2021 at 15:37
- Hi Tom. Thanks for the response. Yes, like table of contents. How do I find every heading(core/heading), add ID, and add heading link to sidebar. – ddd Commented Apr 6, 2021 at 8:24
1 Answer
Reset to default 0Update on this. I got the answer! I followed this simple code from https://goran-s.in.rs/table-of-contents-wordpress-without-plugin/
It's working fine!
本文标签: filtersWordPress Gutenberg coreheading block (wpblockheading)
版权声明:本文标题:filters - WordPress Gutenberg coreheading block (wp-block-heading) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741632293a2389438.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论