Retrieve custom post type data

Support MB Blocks Retrieve custom post type data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #45688
    AnnemijnAnnemijn
    Participant

    Hi,

    Is there a quick guide somewhere to guide me in making a block which has only one field that looks up post in a custom post type? I have CP with Videos and I want to create a Gutenberg block that retrieves the embed code of the CP so I can let people easily add videos into a post, without the need of searching for that video on YT again.

    #45690
    PeterPeter
    Moderator

    Hello,

    There isn't an easy way with a few clicks to render the custom block. You can create the custom block with the builder and use the code to render the block content and field value. Please follow the documentation https://docs.metabox.io/extensions/mb-blocks/#rendering-the-block

    #45692
    AnnemijnAnnemijn
    Participant

    I might be looking wrong, but I don't see any documentation in regards to retrieving (querying) data from a custom post type?

    This might be a nice idea for a next YT video on MB's channel. 🙂

    #45696
    PeterPeter
    Moderator

    You can refer to this topic to create a query in the callback function to display the post type and its data https://support.metabox.io/topic/post-meta-custom-field-inside-query-loop-block/

    If you're not able to complete the task, we offer a customization service for an extra fee. Please contact us here for more details https://metabox.io/contact/

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