Advanced Custom Field Widget is a great plugin that I have ever seen for creating our own custom field in WordPress blog. This plugin will make our blog more flexible like any other CMS. We can avoid lots of unwanted,complicated codes and time by using this advanced custom field widget.
How to use Custom fields in your theme?
get_post_meta($post_id, $key, $single);
- Here the $post_id is the ID of the post that we want the meta value for.
- $key is indicating a string contain the name of Meta value.
- $single can either be true or false. The function will return a single result if $single is true, And will return a array and if $single is false or not set.