Pull a field from a different post

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16123
    DraganDragan
    Participant

    Hi,

    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 MetaBox.io 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] MetaBox.io 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:
    http://prntscr.com/p5vi2v

    #16127
    Anh TranAnh Tran
    Keymaster

    Hi,

    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?

    #16136
    DraganDragan
    Participant

    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 )

    #16144
    Anh TranAnh Tran
    Keymaster

    Is this what you want?

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