insert custom fields in single.php
-
I have recently purchased price calculator script (not plugin) working perfectly on my buddypress blog in single.php, example here: http://www.4ella.com/2011/11/hospitone-night-club-olbia/
In the code in single.php I have following code and I would like to change the value with value from custom fields:
<fieldset><label><input type="radio" name="f_1" value="Price1" checked="checked" data-cost="60" /> Price1</label> <span class="staticPrice"><span class="hypen"> - </span>€60</span> <label><input type="radio" name="f_1" value="Price" data-cost="70" /> Price</label> <span class="staticPrice"><span class="hypen"> - </span>€70</span></fieldset> </div> <div class="option o-2">data-cost=”60″ is a value which I want to change dynamicaly depending on custom field in every post. How can I implement custom field code in every data-cost=”price1 custom field value” ?
data-cost="<?php echo get_post_meta($post->ID, 'key', true); ?>"doesnt work for me 🙁 , do I have to change something in functions.php to make it work ?
The topic ‘insert custom fields in single.php’ is closed to new replies.