Custom Fields
Re-Envisioned
Support MB Elementor Integrator MB Relationships in Elementor PRO

  • Creator
    Topic
  • #30318
    Resolved DANIEL FITIPALDO R.
    Participant

    Hi,

    I've cretaded a custom post type Expert, and a 1:N relationship Experts (1) -> Posts (N). Experts is the post type parent (From) and Posts the post type child (To) of the relationship.
    I've added some custom fields (such as Name and Age) to Experts post type using Metabox plugin. I am using Elementor PRO for designing the single post template for Posts and I want to include the values of the Expert parent custom fields (Name, Age) related to the particular Post in the Posts template.
    I know how to refer to the Post custom fields from Elementor PRO using Dynamics Tags and selecting Meta Box field but I don't know how to refer to the values of the parent Expert post type.
    How can I do that? Is it possible?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #30320
    Long Nguyen
    Moderator

    Hi Daniel,

    It's not possible to show the custom field value of a related post in Elementor. You need to create your own shortcode get it and add the shortcode to the builder.

    #30327
    DANIEL FITIPALDO R.
    Participant

    Ok, thanks for the shortcode tip!
    Do you have any basic example of a snippet with this functionality to share?
    thanks again.

    #30436
    DANIEL FITIPALDO R.
    Participant

    You can close this ticket as resolved.
    The API attached works fine!!!

    $pages = MB_Relationships_API::get_connected( [
    'id' => 'posts_to_pages',
    'from' => get_the_ID(),
    ] );
    foreach ( $pages as $p ) {
    echo $p->post_title;
    }

    https://docs.metabox.io/extensions/mb-relationships/

    #30821
    A
    Participant

    -

    #30822
    A
    Participant

    Hi - What would such a shortcode look like?? I'm trying to get Elementor to pull data from a relationship post into the color picker field. Thank you @longnguyen

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