Using custom fields to display repeating text
-
Hi all,
I write product reviews and the product name comes up repeatedly. I’ve created a custom field for this but am having problems getting it to display. I added this to functions.php:
function get_custom_field_value($szKey, $bPrint = false) { global $post; $szValue = get_post_meta($post->ID, $szKey, true); if ( $bPrint == false ) return $szValue; else echo $szValue; }(Source)
Now here’s where I show off how little I know 😉 Can I just drop the code to call it into an html post, or do I need to use it in a template file?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Using custom fields to display repeating text’ is closed to new replies.