Hi there,
Can you clarify what you are trying to achieve with the ACF function? Maybe send us a quick screen recording of what you want to accomplish?
I do not suggest you override the single.php as there is a lot going on in terms of hooks and how the content and all the sub-templates files area loaded into the page. Using the hooks made available through WordPress hooks functions and the Kadence Theme you can hook in your custom fields anywhere without having to override templates and potentially break the makeup of the pages.
I’m happy to offer some help pointing you in the right direction for using hooks. I’m not entirely sure what you are going for but I’ll give you an example that may help you and then you can ask follow up if needed.
I suggest you use a Code Snippet plugin so you could safely add something like this: https://kadence-theme.com/knowledge-base/advanced/how-to-add-a-custom-filter-or-function-with-code-snippets/
Let’s say you want to add a custom meta field before the excerpt content for archives of a custom post type you’ve created with the slug custom-post-type.
add_action( ‘get_template_part_template-parts/content/entry_summary’, ‘custom_add_fields_before_excerpt’ );
function custom_add_fields_before_excerpt() {
if ( ‘custom-post-type’ === get_post_type() ) {
the_field( ‘custom_field’ );
}
}
without needing to create a new function if you wanted this same custom field to output before the post content of your single post page you could add this action:
add_action( ‘get_template_part_template-parts/content/entry_content’, ‘custom_add_fields_before_excerpt’ );
I hope this helps and let us know how we could help you further.
Kind Regards,
Michael