Hi, I have the same problem.
I am using the TOC widget to list the headings. The widget allows me to activate following content types, but in the end it shows nothing when using ACF:
- post
- page
- acf
- wpcf7_contact_form
- tablepress_table
So, is there already a solution with TOC and ACF?
BR
The problem is that @mike is accessing $post->post_content directly as a database field.
Instead, this needs to happen with get_the_content() function call, so you could filter your custom content in. Now this is still one step away from having effortless integration from custom field managers, but with this change, at least it would be possible to do an integration.
Hi ikraav, so how can we do to solve this? Do you have any filter thar we can apply? Thanks.
Hi Ikraav,
Thanks for your answer. I hope Mike will update the plugin soon.
Best
Well, I did some more thinking on this with https://github.com/dashaluna/hm-content-toc/issues/2
get_the_content() is not enough, because it doesn’t apply any filters, which means the table of contents building will not trigger.
Generally, you have to filter all your custom field content into “the_content” filter output. This means template changes.
The other, more radical, way to do this is to full page output buffer capture with ob_start() and filter the TOC contents in later.
Right now I’m running a custom-patched dashaluna/hm-content-toc for my purposes. There is no readily available solution at the moment, as far as I can see. The world definitely needs one.