• Hi,

    I’m looking for a simple way to print or echo all the custom fields associated with a current post, without pulling them in a single like manner. So basically just a big dump in a list of all the custom fileds in a post.

    I’ve been tooling around with this:

    http://codex.wordpress.org/Function_Reference/get_post_custom

    But I can’t get it to actually work. I’ve looked at snippits and functions online but they seem very complicated.

    Does anyone have a suggestion on how to do this?

    Thank You

    Nadine

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nadine00

    (@nadine00)

    Well <?php the_meta(); ?> worked, but now I have to basically find a way to do this:

    <li><a href="$meta_value">$meta_key</a></li>

    Which I think involves some kind of array parsing. But I am currently unsure on how to achieve this.

    Thanks.

    Nadine

    Thread Starter nadine00

    (@nadine00)

    Soooo….I can get the keys using http://codex.wordpress.org/Function_Reference/get_post_custom_keys …but the values want a specific key in the options.

    I still don’t know why the original custom snippit does not work: `<?php

    $custom_fields = get_post_custom($post->ID);
    $my_custom_field = $custom_fields[‘my_custom_field’];
    foreach ( $my_custom_field as $key => $value )
    echo $key . ” => ” . $value . “<br />”;

    ?>`

    Stumped.

    Anyone? Or another way to pull values?

    Thanks

    Nadine

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘display all the custom fields in the current post’ is closed to new replies.