I'm trying to display custom fields on all my posts using PHP. I know what code I need to add I just dont quite know where to add it. I have tried in my single.php and the content.php files of my child theme, but it hasn't worked. Its a very easy thing to do I just dont quite know where to put the code. The site im building is hidden link and its using the MH magazine lite theme.
I have read and understand this page https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/#1
I just dont know exactly where the necessary code =(
Any and all the help will be greatly appreciated.
You need to edit (or create) the correct theme file so that the custom field is displayed only where you want it:
https://developer.wordpress.org/themes/basics/template-hierarchy/
You can find the code to display a custom field in the documentation you posted:
<?php
echo types_render_field("custom-field-slug-name", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));
?>
Another solution is to use our Views plugin for this, it requires no coding:
https://toolset.com/home/views-create-elegant-displays-for-your-content/#purchase