• Hi I want to create a description under menu items using Custom fields

    That’s the code I got but only shows just one value for the custom field called subtitulo:

    $texto = get_post_meta($post->ID, 'subtitulo', true);
    <p>echo $texto</p>

    Any idea?, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Your question is not clear – do you have more than one custom field named subtitulo in a single post? You are trying to retrieve more than one subtitulo from one post?

    Then leave the 3rd parameter, true, off. just
    $texto = get_post_meta($post->ID, 'subtitulo');

    That will return an array of all the entries with that name

    http://codex.wordpress.org/Using_Custom_Fields#Getting_Custom_Fields

    Thread Starter aurrutia

    (@aurrutia)

    Thanks stvwlf,
    No, I want to retrieve one value from subtitulo custom field (1 per post) to show under every menu item, it’s kind of description from every menu item.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Menu description’ is closed to new replies.