Forums

Show specific 'custom post type' post's custom field data (3 posts)

  1. Allen Tullett
    Member
    Posted 4 months ago #

    Hello,

    I have created a custom post type called 'slide' and for each 'slide' post I have created four custom fields called 'title', 'description', 'image', and 'link'.

    My intention is to where required, outside of the loop, load 'title', 'description', etc. for one specific custom 'slide' post. I wish to repeat this a couple of other times elsewhere on the same page separately.

    Can this be done or have I made it more difficult that it needs to be?

    Thank you for any help you may be able to provide.

  2. vtxyzzy
    Member
    Posted 4 months ago #

    Both get_post_meta() and get_post_custom() take a post ID as a parameter. You should be able to use those functions to do what you want.

  3. Allen Tullett
    Member
    Posted 4 months ago #

    Thanks vtxzzy, you're a star. The get_post_custom function worked perfectly for me. Surprised I hadn't found that one before.

Reply

You must log in to post.

About this Topic