Forums

[resolved] Post meta - returning the 'class' key (3 posts)

  1. SteelFrog
    Member
    Posted 2 years ago #

    I'm trying to use post meta data for the first time and I seem to be running into some issues.

    I've setup a post with the custom "class" key and using "normal" as a value. In my index page, I call this using the following:

    <?php get_post_meta($post->ID, 'class', true); ?>

    Unfortunately, this does not return any value. Am I doing something wrong, or did I miss a step?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Try <?php echo get_post_meta($post->ID, 'class', true); ?>

  3. SteelFrog
    Member
    Posted 2 years ago #

    That did it. Can't believe it was that simple. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic