get_post_custom_values problem – receives error on page?
-
Hi!
I’ve inserted this code in archive.php:
<?php $mykey_values = get_post_custom_values('distance'); foreach ( $mykey_values as $key => $value ) { echo "($value km)"; } ?>
but I get this warning:
“PHP Warning: Invalid argument supplied for foreach() in D:\Sites\Bedui\www\wordpress\wp-content\themes\retromania\archive.php on line 44 PHP Warning: Invalid argument supplied for foreach() in D:\Sites\Bedui\www\wordpress\wp-content\themes\retromania\archive.php on line 44 “Can anyone see what I’ve done wrong?
The custom value is a certain number of kilometers that I’ve cycled on that day. ??
Thank you!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘get_post_custom_values problem – receives error on page?’ is closed to new replies.