Support » Fixing WordPress » <?php get_post_custom_values($key);?> Not Quite Working

  • Hello,

    I’ve been trying to add a custom set of Custom Fields to display under my post contents, by editing theme/index.php, adding

    <?php get_post_custom_values($Feedback);?>
    just after
    <?php the_content(''); ?>

    but nothing displays, and there’s no PHP errors displayed in the browser. Have cleared the browsers cache, and <?php get_meta ?> works fine.

    Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael


    Forum Moderator

    what is the value of $Feedback – or is ‘Feedback’ supposed to be the key name?

    besides, the function returns an array, but does not actually output anything. (see the example in the above link)

    The custom field is labelled Feedback under admin.

    I just tried several routes, all giving Invalid Argument errors, such as

      $mykey_values = get_post_custom_values('Feedback');
      foreach ( $mykey_values as $key => $value ) {
        echo "$key  => $value ('Feedback')<br />";

    I also tried it with <?php get_post_custom_values($Feedback); ?> beforehand. I just don’t understand enough about PHP to logically figure it out. What’s the base code to put in, and have the Key’s been entered correctly in my example above?


    My complete code so far has been this below, but no joy. Does this look right to you all?:

    <?php get_post_custom_values($Feedback);
    $mykey_values = get_post_custom_values(‘Feedback’);
    foreach ( $mykey_values as $key => $value ) {
    echo “$key => $value (‘Feedback’)

    I think you are missing argument in get_post_custom_values().

    get_post_custom_values( 'your_key', $post->ID ).

    Hope it helps

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘<?php get_post_custom_values($key);?> Not Quite Working’ is closed to new replies.