• Resolved Steven

    (@spstieng)


    I’m a bit confused now.

    I thought get_post_meta was used to retrieve page attributes, while get_post_custom_values was used to get post attributes.

    Is custom attributes retrieved diferently from a post than from a page?

    The following code does not output anything:
    echo get_post_meta($post->ID, 'show_categories', true) . '<br />';

    But this code does out put the attribute value:

    $categories = explode(",", get_post_meta($post->ID, 'category_id', true));
    echo $categories[0];

    I just don’t get it.

  • The topic ‘Post custom attribute vs Page custom attribute’ is closed to new replies.