I'm trying to create a function to display either a theme option or custom images based on user input.
So basically, it's a custom meta box. The user selects either a display header image OR they can upload one they want to use.
I've created a custom function to call later on the single page template. This is what I have so far.
//El display image
function el_display(){
global $post;
$eldisplay = get_post_meta($post->ID, '_cmb_el_theme', true);
$elcustomdisplay = get_post_meta($post->ID, '_cmb_custom_image', true);
if(isset($eldisplay)){
echo '<img src="' . $eldisplay . '" />';
}elseif(isset($elcustomdisplay)){
echo '<img src="' . $elcustomdisplay . '" />';
}else{
echo '<img src="' . EL_IMG . 'mobile-development.jpg' . '" />';
}
}
When I call the function later (using el_display(); ), there is no display image showing. I'm a little stuck and have been trying to fix this for hours.
Any help would be much appreciated, thanks!