Return to Snippet

Revision: 19266
at December 1, 2009 06:30 by LuckyShot


Updated Code
/**
 * Custom Field
 **/
// From the current post (as string)
$value = get_post_custom_values("customfield");
// From the current post (as array)
$values = get_post_custom_values("Thumb"); echo $values[0];
// From another post
$value = get_post_meta($id, "customfield", 1);
// From another post (as array)
$values = get_post_meta($id, "customfield", 0);

Revision: 19265
at December 1, 2009 06:18 by LuckyShot


Updated Code
/**
 * Custom Field
 **/
// From the current post (as string)
$value = get_post_custom_values("customfield");
// From the current post (as array)
$values = get_post_custom_values("Thumb"); echo $values[0];
// From another post
$value = get_post_meta($id, "customfield", 1);
// From another post (as array)
$values = get_post_meta($postid, "customfield", 0);

Revision: 19264
at December 1, 2009 05:17 by LuckyShot


Updated Code
/**
 * Custom Field
 **/
// From the current post (as string)
$value = get_post_custom_values("customfield");
// From the current post (as array)
$values = get_post_custom_values("Thumb"); echo $values[0];
// From another post
$value = get_post_meta($postid, "customfield", 1);
// From another post (as array)
$values = get_post_meta($postid, "customfield", 0);

Revision: 19263
at October 20, 2009 04:06 by LuckyShot


Initial Code
<?php $values = get_post_custom_values("Thumb"); echo $values[0]; ?/>

Initial URL


Initial Description


Initial Title
Wordpress - Custom Field

Initial Tags
wordpress

Initial Language
PHP