Code for WP “file size” Field
-
Hi, David!
For my media library (http://cousin-collector.com/blog/?page_id=690), I’ve been able to use either IPTC metadata or the WP media item information for my listings. The one thing that’s evading me is the file size. I see that WP lists that information, but I don’t know the code to access it, so it has to get it from the photo or PDF itself each time the page is loaded.
For instance, the first PDF in the list has this line:
Uploaded: 12 March 2017 Modified: 12 March 2017 (293.0 KB)
I’m using:
{+file_size,kbmb( 1024 , ' KB', ' MB', 1 )+}But IIRC it would be more efficient to access the WP field for this? Such as with the Description field?
{+description+}Thanks!
Kris
The topic ‘Code for WP “file size” Field’ is closed to new replies.
