In a recent task that I worked on, the requirement was to set up a custom field called "Related Services" for Posts and display this field's value in a sidebar widget. The widget should appear on the front-end i.e., on the single Post page only if the field has been populated for that particular Post.
In this article I share the tweaked code based on the example given in codex on creating a widget which displays the value of a custom field created using Advanced Custom Fields (ACF).
Custom field in the Post editor:
Widget in the sidebar:
On the single Post page:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.