Support » How-To and Troubleshooting » get post custom values

get post custom values

  • Whenever I use get_post_custom_values, it does not return anything even though I have set up a custom field and have verified it within the wordpress database. So here’s my code:

    $value = get_post_custom_values(‘somevalue’);
    foreach ($value as $key => $value) { echo $key.”-“.$value.”
    “; }

    I was doing this as a quick test to see if the values would even show up and they were not. So I did a quick test:

    if ($value) { echo “set”; } else { echo “unset”; }

    I added that into the template to see if the variable was even being set and it was not. I have tried multiple things and nothing works. I need to be able to do this for the website to work correctly. Has anyone else had this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get post custom values’ is closed to new replies.
Skip to toolbar