WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] display post meta data (4 posts)

  1. martcol
    Member
    Posted 1 year ago #

    I am having trouble displaying custom meta data. I have tried these two bits of code in my loop:

    echo get_post_meta($post->ID, 'towns', true);

    $key="towns"; echo get_post_meta($post->ID, $key, true);

    They both display "Type Town" and I want to only display the data which is the actual town.

    Can someone tell me where I am going wrong please?

    Thanks

    Martin

  2. martcol
    Member
    Posted 1 year ago #

    Sorry, I figured this out now.

    Thanks

    Martin

  3. jamesg40
    Member
    Posted 1 year ago #

    can you tell me what you did? I am trying to display some custom fields from posts and cant get anything to display from them.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    @jamesg40: As per the Forum Welcome, please post your own topic. Posting in an existing topic prevents us from being able to track issues by topic. Added to which, your problem - despite any similarity in symptoms - is likely to be completely different.

    Oh - and I deleted your earlier, unnecessary comments.

Topic Closed

This topic has been closed to new replies.

About this Topic