Trouble with Custom Fields (please help!)
-
Hello Everyone,
I’ve come to you for help!
I am having some difficulty displaying content on new custom fields in my posts. Here is the breakdown – I am creating a new custom field in a post and a key =
“property_address”
. I am then attempting to pull the content in“property_address”
by use of the following loop (which I’ve inserted in mysingle.php
template file):<?php $property_address = get_post_meta($post->ID, 'property_address', true); if($property_address != '') { echo “Property Address: " . $property_address; } ?>
Do you see anything wrong with this function? Unfortunately, the loop is not displaying any of the values under new fields, such as
'property_address'
. Yet if I were to reference other custom fields (which have been automatically created by the template I am using or plugins), the loop successfully displays the value.I am wondering whether there might be any issues with the code above or if there are any known issues with pooling newly added fields.
Thanks in advance to everyone for all the help.
Alberto
- The topic ‘Trouble with Custom Fields (please help!)’ is closed to new replies.