substr function not working
-
Hi David,
I am using MLA to create a gallery of pdf documents, which is working great. Thank you for the plugin.
I got 2 related problems:
I have 10 pdf to show and I want to have 6 per row. If one of the caption texts has more lines than the last one in the row, the items in the next row get moved to the right until they are one right of the one with the long caption text.likes this:
s = pdf with short caption
l = pdf with long captionssslss ss ss
Which leads to my second problem, I tried to go around the problem by shortening the caption with substr. Unfortunately it is not working, it returns an empty string for me.
[mla_gallery attachment_category='vending-report' columns=6 link=file orderby=date order=DESC post_mime_type=application/pdf mla_target='_blank' mla_caption='{+caption,substr(0,20)+} ({+custom:File Size,kbmb(t, K, MB,2)+})']
And when I am already writing. I used the kbmb function and the only argument I wanted to use was p to limit to 2 decimals. But this only worked if i passed all other arguments.
kbmb(t, K, MB,2)
I tried to use
kbmb(,,,2)
without success.Wordpress: 5.2
Media Assistant: 2.79
PHP: 7.2.18 FPMUnfortunately I cannot link to the site as it is on a development server.
- The topic ‘substr function not working’ is closed to new replies.