This code requires both a width greater than or equal to 1, and a caption. You could try removing these lines:
if ( $atts['width'] < 1 || empty( $atts['caption'] ) )
return $content;
That may affect other functionality, but it is the point where the script skips the image entirely.
Related Posts:
- PHP code to call image Caption, Alternative Text, and Decription?
- Not able to remove caption shortcode from the content
- Replace background image with post thumbnail in shortcode
- How to add a PHP scripts into WordPress
- Display Current Time using shortcode
- Adding caption to all images inside an article
- How to add a shortcode for an image in the following function
- How to get WordPress Time Zone setting?
- Converting timestamps to local time with date_l18n()
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Return HTML Template Page with PHP Function
- How do I change/modify the_post_thumbnail(); html output?
- What’s the best way to use the Featured Image for responsive web design?
- Encode text string being appended as query to URL [closed]
- How to have different captions for same image, for galleries?
- Featured image shortcode
- How to add a class to the attachment images
- How do I hook into WordPress to save an uploaded photo as an alternate size to an existing photo?
- How to check if image is already stored in a site’s post database? (network)
- How do I use Shortcodes inside of HTML tags?
- Is there a way to parse shortcodes in PHP?
- Adding a custom image upload size and making it selected by default?
- Hide custom image sizes from media library
- Change the filename format of saved featured images
- How to draw media details for Isotope gallery using Photoswipe
- Shortcode to insert
- PHP function showing wrong time in WordPress
- How to register images uploaded via FTP in media library?
- Shortcode putting html such as
- Create Image Uploader for Widget
- Using file_exists to check file in Uploads
- Display sorting options dropdown when using WooCommerce product category shortcode
- Retrieve multiple values passed to a single attribute in a shortcode
- Permanently remove first image from posts
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- How to get year, month and hour in WordPress?
- WordPress Shortcode and Dynamic CSS
- ob_get_clean returns empty string, ob_get_flush outputs string
- Rename image uploads with width in filename
- Display a text message if the shortcode is not found?
- Export User Info to CSV from Front End
- Admin Media grid view images won’t load
- WordPress remove EXIF Data from specific Thumb
- Debugging upload problem: What part of WP does actual image-resizing?
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- How to display a shortcode caption somewhere other than the_content
- Shortcode created to check language not works
- How to resize image on client-side before upload?
- Adding Featured Image to Post programatically
- Add custom image sizes to media uploader
- Why does this echo values in the wrong order?
- Conditional Statement – check if post has an attachment image
- How to return a string that has a variable inside in a shortcode?
- Run shortcode at certain resolution
- Using Echo in ShortCode – Stuck
- Passing a shortcode attribute to a sub-function
- How to upload imagick resource to media in wordpress
- How to create shortcodes that pull custom field data from general settings
- post meta value as shortcode parameter
- How to protect own PHP code from WordPress updates
- Add/echo div with Analytics-Code to function in functions.php
- Use Filename for Alt and Title Tags
- Change Width of Featured Image Thumbnail on Add/Edit Post Page
- Creating a WordPress shortcode
- WordPress returns a wrong date
- Multiple do_shortcode($content) within one shortcode
- Adding Image Count to Multigallery
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- How to check for WordPress timezone type?
- Get a Page’s attachments in Gallery order
- Get list of shortcodes from content
- Audio tags around Mp3 URL in content
- How do I hardcode a WordPress shortcode into my theme?
- Loading page template into shortcode
- Use Timber/Twig to pull an image by image ID [closed]
- Adding graphics to 404.php page
- How do I get images (with a thumbnail preview) to show in search results?
- My shortcode is showing up twice
- How to get custom image size for image uploaded in Customizer
- How to add Shortcode (font awesome) in widget title?
- Add custom HTML to posts page
- has_shortcode() – how to detect nested shortcode
- Strip Image Classes from HTML Output
- Additional image sizes are not being generated
- How to return multiples lines in a shortcode?
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How can I default to all WordPress roles when parameter is not included in shortcode?
- WordPress menu deletes when trying to add a hook
- PHP contact form returns warning in text widget [closed]
- Unable to set right time in admin and frontend template
- Using wp_get_image_editor in a standalone script
- How to find the output of contact form 7 shortcode? [closed]
- Wrap each shortcode in array to div
- How do i get (unique) page name?
- Adding a querystring to an image URL when clicking ‘insert into post’?
- Assign a picture URL to a page via PHP
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- How to insert a local image with custom size
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Change logo based on incoming domain