how to retrieve custom field value as a function
-
Hi, im interested in having a custom field “url” and in the value, add a url, that part is easy
however I want to create a function $site, which can be echo′d inside of single.php in order to reproduce the value, I have no idea how to do this, Ive searched the codex, and it provides examples for slightly more complex things, such as showing the values of all custom fields in an array or ordered list and it gets a bit confusing for me
I’ve tried using
<?php $site = get_post_meta($post->ID, 'site', true); ?> <?php echo $site; ?>
thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘how to retrieve custom field value as a function’ is closed to new replies.