Posted By

LuckyShot on 10/20/09


Tagged

wordpress wp


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

LuckyShot


Wordpress - Custom Field


 / Published in: PHP
 

  1. /**
  2.  * Custom Field
  3.  **/
  4. // From the current post (as string)
  5. $value = get_post_custom_values("customfield");
  6. // From the current post (as array)
  7. $values = get_post_custom_values("Thumb"); echo $values[0];
  8. // From another post
  9. $value = get_post_meta($id, "customfield", 1);
  10. // From another post (as array)
  11. $values = get_post_meta($id, "customfield", 0);

Report this snippet  

You need to login to post a comment.