Custom Fields
Re-Envisioned
Support MB Custom Post Type Shortcodes don’t display on custom posts

  • Creator
    Topic
  • #18102
    Resolved Allan
    Participant

    Hello,

    I have a custom post type called “Cat’s Profile” and another custom post type call “Dog’s Profile”.

    When I place this short code, [rwmb_meta id="cats_age" ], created for the “Cat’s Profile” on a post under “Dog’s Profile”, nothing shows up. Is there a way to display custom fields between custom posts?

    Thanks!

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #18105
    Anh Tran
    Keymaster

    Hi Allan,

    The shortcode rwmb_meta you use assumes that the field value it gets is for the current post (which is a dog profile). That’s why it doesn’t output anything, since cat’s age is a cat’s custom field.

    To display a custom field of a cat profile, please pass the object_id to the shortcode: [rwmb_meta id="cats_age" object_id="123"].

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

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash