HI - I'm trying to populate a simple custom field we are using in wordpress POSTS with a default placeholder in the event that the field is not populated. I've found the placeholder element in the custom field editor but I'm not sure that I did this correctly as it isn't working on the front end.
The field is for a "BYLINE" - i.e., the author of the article. We take incoming JSON files that are populated from another digital asset management system - the text they send over is post_byline: "", - if populated it would read post_byline: "John Doe",
On the front end we display it as "Byline: John Doe"
I'd like this to default to "Catholic News Service" in the event there is no incoming content for the field. See attached where I've set the placeholder text. But I think I must be missing something. Shown also is the shortcode in the post template.
A default value will be inserted in the field in the post edit screen (or in a front-end Toolset Form) when you add a new post.
The text is added to the field input, where it can be left or modified. Only when the post is subsequently saved will the post actually have that value.
It sounds like you are not creating posts from the post edit screen or from front-end forms, so this default is unlikely to work in the way you intend.
You will likely have to use some custom code to set the value for the field if no value is present.
If you can share more details about how your posts are created, one of the supporters should be able to give you some pointers on what to use.