Hi @pagecrawler,
Thanks for reaching out to our support threads. Could you please try using either of these codes?
get_post_meta( $post->ID, ‘_unavailable’, true ) === ‘yes’
get_post_meta( get_the_ID(), ‘_unavailable’, true ) === ‘yes’
Thanks and please let us know if this works for you.
Regards,
Mej, from the Widget Options Team
Thank you for your support.
Unfortunately the above code does not work. The widget does not appear on the front end when either of the codes are used, even when reversing the statement eg:
get_post_meta( $post->ID, ‘_unavailable’, true ) !=== ‘yes’
Hi @pagecrawler,
It is working on our end. But I understand we might have different set up. We will look further into this.
Kind Regards,
Mej, from the Widget Options Team
Hello @pagecrawler
I have reviewed the code snippet:
get_post_meta( get_the_ID(), '_unavailable', true ) === 'yes'
It is working correctly on my end.
Could you please confirm if the value saved in get_post_meta( get_the_ID(), '_unavailable', true ) is actually 'yes'? I ask because there is a possibility that the saved value might be the boolean true instead of the string 'yes'.
Thank you,
Mej, from the Widget Options Team
Hi @pagecrawler,
I hope you are doing well. Have you managed to display a widget on your custom post pages using the cod snippet?
Thanks and we are waiting for your reponse.
Kind Regards,
Mej, from the Widget Options Team