Insert a default text if custom field is empty
-
Hello all,
I am finishing up on a client’s website.
They sell classic cars, so there are some prices they do not wish to displose online.I have been able to customize heavily the metaboxes which came with the metaboxes already included in the theme to do exactly what I wanted, but this is the last function I haven’t been able to implement.
What i think is best for them is that, if they leave the price field empty, the sentence ‘P.O.A.’ would display automatically (as adding a checkbox which hides the price would be probably too heavy code-wise).
Currently, it shows a basic “<?php listing_price(); ?>” to get the price. If knwo I need an if and else function here, but I don’t know how to code it.
Thank you for your help.
Best,
Yann
- The topic ‘Insert a default text if custom field is empty’ is closed to new replies.