Custom Fields
Support MB Blocks Retrieve ID from Post field

  • This topic has 2 replies, 2 voices, and was last updated 9 months ago by JC.
  • Creator
  • #22622
    Resolved JC

    I want to build a block where I can select a CPT post in the backend and the block should display some custom fields of the selected post in the front end.

    So I created a field group with a WordPress post field, where I selected the CPT as Post Type.

    In the Render Code I want to retrieve the ID of the selected post and either send it to a php function or use the values of some custom fields of the post directly.

    When I enter this into Render Options (Code):

    <h2> Output: {{ grid_select_post }}</h2>

    It gives me a html link with the title of the post.

    How can I retrieve the ID instead?


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