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

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 4 weeks, 1 day ago.

  • Creator
    Topic
  • #16123

    Dragan
    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

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

    Anh 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

    Dragan
    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 Tran
    Keymaster

    Is this what you want?

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.