Custom Fields
Support MB Custom Post Type Pull a field from a different post

  • Creator
  • #16123


    NOTE: this question might not be related to this extension but I'd really appreciate an answer.

    I have a custom post type (gallery, not created with MetaBox) and in it I have a field [Image Upload] where I add my gallery images.

    Now, I want to pull those images from another regular post. What is the best way to do that (code would be much appreciated)?

    If you need further info:

    On my regular posts:
    I have post format support for 'gallery' format
    I need a [select] field which lists all my 'gallery' post types

    AND I have a 'gallery' custom post type (which contains only your 'Image Upload' field, title and slug).

    I will use the gallery custom post type to upload the images for the gallery and the idea is:
    When editing a normal, regular post, I want to grab images from a particular gallery (grab the images from 'Image Upload' field, from a specific 'gallery' custom post, by its ID).

    I also drew what I want to achieve if I'm not making any sense, please see the provided screenshot:

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #16127
    Anh Tran


    I'm not really clear because the term gallery is used in both post types.

    Where do you want the select field? In the gallery post type or in regular post?

    Doesn't the post field allow you to select a specific post?


    Hi Anh Tran, I managed to do it by myself.

    Can you paste in the code how to pull 'sizes' from 'Image Upload' field and place sizes inside tag, thank you. ( because $image['sizes'] causes array to string conversion notice )

    Anh Tran

    Is this what you want?

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