Forums

get post custom function help (1 post)

  1. theorboman
    Member
    Posted 1 year ago #

    Hi,

    I've got a template where I need to grab the values of several different custom fields associated with a post.

    I can do this fine using the get_post_meta function - ie:

    <?php $profile_pic = get_post_meta($post->ID, 'profileimage', true);
    if($profile_pic) : ?>
    <img src="<?php echo $profile_pic; ?>" alt="<?php the_title(); ?>" />
    <?php endif; ?>

    But as there are up to 3 more custom post values to get I figure it's much more efficient to grab them via the get_post_custom function. I can't find in either the documentation or via any amount of searching on Google an explanation of how to retrieve the different values of the different keys using this function.

    Can some kind soul enlighten me?!!

Topic Closed

This topic has been closed to new replies.

About this Topic