Forums

Unstyling custom fields (2 posts)

  1. yolise
    Member
    Posted 3 years ago #

    I've searched the docs and forum, but may not be looking for the right thing...

    I want to display the custom field unstyled - in other words, I don't want to display it as a list. Nor do I want to display the name of the field or the colon.

    Basically, I have a page that I want to display in the sidebar as Corporate, but on the page as Corporate Services. Because pages don't have descriptions, or summaries, all I can think of to use is using the custom field to add "Services" to the parent pages (the child pages wouldn't need the word "Services" so I haven't hardcoded it into the page template).

    Is there another way to do this. It's very much a hack.

  2. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    Try this:

    $myVar = get_post_meta( $post->ID, 'custom_fields_key', $single=true );

Topic Closed

This topic has been closed to new replies.

About this Topic