Tag Info

Hot answers tagged


You can use get_attached_file() to: Retrieve attached file path based on attachment ID. And get_post_thumbnail_id() to determine the post thumbnail of the current post, or any post if you set the $post_id parameter. Exemplary usage: $bytes = filesize( get_attached_file( get_post_thumbnail_id() ) ); Use size_format() to ...


You're not passing your attribute array to the shortcode_atts method. You're passing in an uninitialized variable. Your function starts with function get_my_gallery_content ( $atts ) { But then you don't reference $atts again. The code is reading $attr, which is empty. Change the line ), $attr, 'gallery')); to ), $atts, 'gallery')); You also ...

Only top voted, non community-wiki answers of a minimum length are eligible