UPDATE Ok, thanks to all for helping me out and pointing me in the right direction. I do have some code clean up to do and a possible all out change in code but I’ll use this for now.
I got it to work with the following code.
//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(!empty($eldisplay)){
echo '<img src="' . $eldisplay . '" />';
}elseif(!empty($elcustomdisplay) && isset($elcustomdisplay)){
echo '<img src="' . $elcustomdisplay . '" />';
}else{
echo '<img src="' . EL_IMG . 'mobile-development.jpg' . '" />';
}
}
Thanks again!
Related Posts:
- Upload multiple images in a custom metabox
- Adding upload button in metabox
- Regenerate missing _wp_attachment_metadata
- Image display from custom field
- Include captions
- Retrieving an alt tag from a custom field
- Get thumbnail url of custom meta image?
- Dynamic tagged image galleries
- Generate images to be associated for tag and category?
- Add custom metabox to media library images
- Display an icon with get_post_meta?
- Remove “%” from strings in serialized arrays in wp_postmeta
- WordPress Featured Image meta box not showing
- Metabox image upload value
- How to join Caption AND Description Meta Fields as one combined-caption in Image Block
- How to Display Image Caption but Not Alt Text
- featured image in custom poste type (backend)
- get_post_meta returning broken path in image src
- problem with updating metabox of upload image
- Adding Image Description below Images Inserted into Posts
- Upload button in metabox not working
- get_post_custom: get image URL instead of image ID
- Adding different classes to different images depending on size for fine control of image layout in posts
- get the attachement url for the medium sized image
- Each custom image size in custom upload directory?
- Is there a simple way to just insert a link to an image (without inserting an image)?
- Watermarking Images with WordPress with WP_Image_Editor
- Get attachment/image info in JS
- Auto-modifying original [full size] images
- Black and White thumbnails
- upload image in a meta box
- Crop image to horizontal or vertical by code based on image size
- Open the attachment details modal
- Download button for Featured Image in every post – automatically
- metabox upload file
- Metabox Data not being saved [closed]
- Can’t access ‘Store uploads in this folder’
- Options to get my custom post type metadata via the WordPress API
- How to Display Featured Image Title and ALT Attribute
- Add attribute to caption shortcode from custom attachment field
- Get an image’s alt text in a shortcode using the image URL
- Add Small Image Size to Media Settings
- Character Limit w/ Excerpt removes Images Why?
- Adding new size for Media screen in functions.php not working
- Faster way to put images into a blog post by using Add Media dialog
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox
- Retrieve an array of image URLs that belong to a gallery
- Help With Custom Image and Text Widget
- Using SRCSET with Images and Featured Images
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- wordpress post pagination with image buttons?
- How can I change get_the_post_thumbnail to make 100% width image?
- Native gallery sorting is ignored
- Disable lazy loading on specific images
- Dynamic image crop in WP 3.0+?
- What can i do add title to ‘large’ image?
- Height and width attribute not setting by the_post_thumbnail
- NextGEN Conditional Statement [closed]
- How to set minimum required size for featured image?
- All Images not calling alt text
- Can we use featured image as third party website image URL
- Can I save post meta programatically without setting metaboxes?
- Exclude image url from search query
- Inserting image into post with different image size
- Editor meta box Showing but not saving
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- Alter the image used for a user who has not uploaded a custom image yet
- save radio button selection in post-meta on submit
- Allow users to upload multiple images to their profile
- how to change format jpg to webp?
- Implementing a modal(lightbox) for all images in all post-gallery posts
- Update Images after edit via php
- How to increase media image scale limit?
- How do I avoid color distortion of uploaded images?
- Where to put code that customizes API
- Force WordPress to always generate a thumbnail for original image
- How to auto add image caption from image alt?
- Change picture attachment meta of all occurrences of a picture
- File upload size limit in wordpress and php.ini limit
- Blank image thumbnails in media library
- Getting extra image links in code with wp_get_attachment_image
- Get “Image CSS Class” value from the Advanced Options section
- After reinstalling wordpress images do not appear in posts?
- Dinamically modifying attributes of images on posts
- Run command to optimize images after they get uploaded to WordPress
- Large size is not honoured when inserting image
- Issue uploading images
- How can I use images that are on the server locally?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- The most of the images don’t appear, although URLs are correct
- Get images uploaded to this post in popup on editor screen
- Remove “align” attribute on images
- How do I add a nested conditional within an echo – to use a default image if there isn’t one in the post?
- How do I change a Themes Header Image?
- Blurry Images WordPress 5.8.1
- Use a Variable in update_post_meta as the $meta_key
- How to show file size of featured image? [duplicate]
- How to import external media items into wordpress media library (without using storage)
- WordPress Site Broken and it gives Headers Already sent error