editing how meta post data shows up in template (3 posts)

  1. tontamoo
    Posted 10 years ago #

    For my posts I've inserted a music custom field -- the song I'm currently playing. I know to display what's in the meta post data I must use this tag: <?php the_meta(); ?>

    However, when I insert it, there seems to be some sort of autoformatting such that the items in the meta data are placed in a list. Which file should I look in to change this. All I want it to do is display exactly what I typed in the field, no frills. How can I do this? I'll format how it looks later via a CSS file and apply it in the template.

  2. Lorelle
    Posted 10 years ago #

  3. Kafkaesqui

    Posted 10 years ago #

    If you just want to pull the custom field value out and use it however you want, try this in your template (within The Loop):

    foreach(get_post_custom_values('music') as $song) {
    echo $song;
    } ?>

    Make sure the argument (i.e. custom field key) passed to get_post_custom_values()is the correct one.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.