Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

WPLatte Framework - Custom Fields WordPress

  • SOLVED

Hello,

I am trying to insert custom fields into single.php in WPLatte framework, but it doesnt work.

There is my custom field in single.php

<?php $url = get_post_meta($post->ID, 'url', true); ?>
<?php $download = get_post_meta($post->ID, 'download', true); ?>
<a href="<?php echo $url; ?>" rel="nofollow"><h4 class="toggle">Purchase <?php echo $download; ?> Now</h4></a>

Answers (2)

2013-02-03

Arnav Joy answers:

try this


<?php $url = get_post_meta(get_the_ID(), 'url', true); ?>
<?php $download = get_post_meta(get_the_ID(), 'download', true); ?>


Arnav Joy comments:

or try this


<?php $url = get_post_meta($post->id, 'url', true); ?>
<?php $download = get_post_meta($post->id, 'download', true); ?>
<a href="<?php echo $url; ?>" rel="nofollow"><h4 class="toggle">Purchase <?php echo $download; ?> Now</h4></a>


Chymmi comments:

Lol this works, maybe its bug ..in a few minuts I will tell you :D
Anyway thanks bro


Chymmi comments:

Yes it works :)
you are my hero :D I had problem with it about 8 hours :(


Chymmi comments:

how I close this answer ?


Arnav Joy comments:

Click on vote to award prize link below your question and then choose amount and click on vote.


Arnav Joy comments:

Also see this

http://blog.tailormadeanswers.com/2011/04/22/voting-assign-prize-money/

2013-02-03

John Cotton answers:

Have you declare $post as global?


Chymmi comments:

I don't know :)
here is my single.php http://jsfiddle.net/xquF8/1/