Forums

Displaying specific information from the_meta() (4 posts)

  1. whiteorb
    Member
    Posted 1 year ago #

    I'd like to pull specific values from the page's custom field. In this case it's a product model number. I've tried adding <?php the_meta(); ?> but it displays the name and the value. I've read the codex but have overwhelmed and confused myself.

    And ideas on how to simply pull a value based on the name?

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    <?php echo get_post_meta($post->ID, "name", true); ?>

    Used within the loop

  3. whiteorb
    Member
    Posted 1 year ago #

    Perfect thanks. Is it possible to seperate values with a colon or semi-colon or do I have to create a new field each time?

    example: name=type
    value=indoor, outdoor, daynight, network

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    just remove the true I believe, or you may have to set it to false...

    http://wordpress.org/support/topic/seperate-multiple-values-in-get_post_meta-with-commas?replies=3

    may help a little

Topic Closed

This topic has been closed to new replies.

About this Topic