Shortcodes don't display on custom posts

Support MB Custom Post Type Shortcodes don't display on custom postsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18102
    AllanAllan
    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!

    #18105
    Anh TranAnh 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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.