Viewing 3 replies - 1 through 3 (of 3 total)
  • Try using something like:

    <?php $color = get_post_meta($post->ID, 'change_colour', true);
    if( $color == 'black' ) :
    [CSS CHANGE]
    endif;?>

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

    Thread Starter frmars

    (@frmars)

    Thanks. It did the job nicely.

    However, may I say the codex on that matter is far too vague and far too unclear for a non specialist like me.

    Compare :

    get_post_custom :
    « returns a multidimensional array with all custom fields of a particular post or page »
    get_post_meta :
    « returns the values of the custom fields with the specified key from the specified post.»

    I don’t know if WordPress has a commercial branch and uses the tremendous success of the free software to make business (and if it’s not, it should), but after browsing through the codex for a few days/weeks now, it could definitely be made simpler AND/OR more complete, to appeal to the larger number.

    Why not hire a written communication debugger and planner ? I am free for hire !

    WordPress commercial activities don’t extend beyond some aspects of wordpress.com and automattic.com. Generally it’s based open open source, community-developed tools and resources.

    If you could help with the Codex and you’d be willing to volunteer a little time, I’m sure your experience would be more than welcome. There is a Documentation mailing list that you might be interested in. Other than that, all it takes is to create a Codex account, read through the Wiki documentation and join in.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘get_post_custom’ is closed to new replies.