How to print on frontend the meta fields we created


If you need display values of the post/custom which are created by built-in meta data constructor, you can use next function:

  • If you are using this on the single page you not need set $post_id, if somewhere in loop you need set this value.
  • If you are sure that you are using reflection, set $look_for_reflection to true. Do not set it simply just like that, it is creates one more MySQL query else, so if you do not need this - do not use.
  • Also you can use next shortcode: [mdf_value post_id=5 key='medafi_price' reflection=1]

Read also: