[Support request] Display Meta Data in Custom Post

Home Forums Support [Support request] Display Meta Data in Custom Post

Home Forums Support Display Meta Data in Custom Post

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #237509
    John

    I am using Generate Press Theme and Premium Plugin.
    I created a custom post type ‘children’.
    The only supports for this post type are title and thumbnail.
    I created meta-data for that post type with key:values for age, gender, interests etc.
    I created a child-theme for GeneratePress and made a single-children.php and archive-children.php by copying the non-post specific versions from the parent theme.
    My Question:
    How so I modify these templates or the content.php template to make the stored meta-data for these posts display?
    Currently I only get the title and featured image.
    Thanks,
    John

    #237512
    John

    I am getting the values to show up now using:
    <?php echo get_post_meta( the_ID(), 'age', true );?>
    I see that there is content.php for the archive template and content-single.php for the single template.
    I would like to set the css for only the meta-data these post types.
    Any tips?
    Thanks again,
    John

    #237533
    Tom
    Lead Developer
    Lead Developer

    The element should have a class specific to the post type in if if you check it out using developer tools (right-click > inspect).

    That class should allow you to add CSS specific to the post type.

    Let me know 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.