Hello,
I'm using the plugin PHP Code Widget to display a custom field in the sidebar by every page.
<?php global $wp_query;
if(is_object($wp_query->queried_object) && $wp_query->queried_object->ID)
{echo get_post_meta($wp_query->queried_object->ID, 'sidebar', true);}
?>
This returns the value of the key Custom Field called 'sidebar".
I would like it to return a default echo (for example, "Well, hello!") if no value for this Custom Field key has been entered.
I've tried a few things but i keep on getting PHP errors.