Shortcode not work in picture source srcset tag

i fix this with a new shortcode that generates the entire tag. Like this: function generate_image_tag($atts) { $atts = shortcode_atts( array( ‘img’ => ”, ‘title’ => ”, ‘theme_url’ => get_bloginfo(‘template_url’), ), $atts ); //File path details $file_info = pathinfo($atts[‘img’]); $file_dir = $file_info[‘dirname’] != ‘.’ ? $file_info[‘dirname’].”https://wordpress.stackexchange.com/” : ”; $file_url = $file_dir . $file_info[‘filename’]; $output=”<picture> <source … Read more

How to display the Media Library Items Upload date

If you have the attachment ID, you can just use get_the_date(): <?php echo get_the_date( ”, $attachment_id ); ?> If you leave the first argument blank, e.g. ”, then it will use the date format from settings. If you don’t want that, then provide a PHP date format.

Hide or mask the url to an image

I don’t believe this is possible. Images are ‘replacement items’ generated by the browser. They’re not IN the html, they’re CALLED by the html. If the reference is wrong, the image will never show. If the reference is right, the image will show… but it will be accessible to the visitor. In other words, if … Read more

Custom Image Widget

There seems to be no official hooks that effect media widgets. It is possible to access the properties of the widgets in the sidebar using the dynamic_sidebar_params hook in combination the $wp_registered_widgets global widget array. However, there is no image widget property for setting the inline styling of the image. Therefore the simplest solution to … Read more