Archived topic
How to show custom fields in the hooks
5 replies · Started by Deep on April 28, 2019
Hi there,
I want to know how to show custom fields in the Hook elements?
Hi there,
To use the template tags?
https://docs.generatepress.com/article/header-element-template-tags/#custom_field-name
If so you actually need to enable custom fields on posts/pages:
https://pagecrafter.com/how-to-enable-and-use-custom-fields-in-wordpress-without-plugins/
Let me know :)
You are not getting my points. I am saying how to display custom fields in hook elements. Please suggest how to achieve that.
Hope you got my point. Thanks.
Custom fields can be output using the get_post_meta() function.
For example:
$custom_field = get_post_meta( get_the_ID(), 'your_custom_field', true );
echo $custom_field;
Thanks for your support.
You're welcome :)