Thank you for your patience while I completed my travels. Now I have time to go back over your earlier posts and give you more detailed assistance.
First, let me comment on your statement: “I wish to pull all other info from post custom fields and MLA custom fields.” The Settings/Media Library Assistant/Custom Fields tab lets you define rules that take information from many sources and copy the information into WordPress custom fields. There is no separate “MLA custom fields”; MLA uses the custom field features already built in to WordPress.
Custom fields are useful because they are part of the SQL database structures in WordPress. You can display them in the Media/Assistant submenu table, sort on them and use them to filter your [mla_gallery]
displays. You can also use the many functions built into WordPress to access and edit them, as you already know.
You have described your goal as follows:
Every post will have only one image, and nothing else in its content box. I wish to pull all other info from post custom fields and MLA custom fields. I need tool to display image info: dimensions, size, image url, exif/itpc image data…
I wish to use theme’s files to display that info. But I do not know how to do that? For example how to display value of some MLA custom field from single.php file, if it is possible?
It is certainly possible to add custom PHP template files to your theme to display an image and information about the image, but that approach is fairly complicated and requires programming skills. The [mla_gallery]
shortcode and the MLA Gallery custom style and markup templates are designed to give you a simpler way to achieve the same results. You don’t say how you will specify “only one image” for your post, but you can use the ids=
parameter to create a single-image “gallery”, e.g. [mla_gallery ids=123]
. There are may other ways to select the image you want from the Media Library, and I can give you more specific help if you need it. Your post content could be just the shortcode; no other content.
To add the information you want, I suggested something like the “Table-based Style and Markup Template Example” found in the Settings/Media Library Assistant tab. Here is the “Item” part of the template used in that example:
<td class='gallery-icon'>
[+link+]
</td>
<td class='wp-caption-text gallery-caption'>
<strong>[+title+]</strong><br />
[+description+]<br />
[+date+]
[+custom:client,single+]
[+terms:category+]
[+iptc:caption-or-abstract+]
[+iptc:2#025,single+]
[+exif:Artist+] </td>
In this example, the [+link+]
substitution parameter in the first table cell will be replaced by the image thumbnail and link. You can control the size of the image and the destination of the link by adding parameters to your shortcode. The second table cell contains several bits of information about the image, drawn from the “Attachment-specific substitution parameters for the markup template Item part” as well as IPTC, EXIF and custom fields assigned to the image. As this example shows, you can get most of the information you want by adding substitution parameters to your MLA Gallery template, without the need to create custom fields for the information ahead of time.
Going back to your stated goal, I think you could use a custom markup template that looks something like this:
Open part:
<table id='[+selector+]' class='gallery galleryid-[+id+] gallery-columns-[+columns+] gallery-size-[+size_class+]'>
Row Open part: (leave this empty)
Item part:
<tr class='gallery-row'>
<td class='gallery-icon'>
[+link+]
</td>
</tr>
<tr class='gallery-row'>
<td class='wp-caption-text gallery-caption'>
<strong>[+title+]</strong><br />
Width: [+width+], Height: [+height+]<br />
File size: [+custom:File Size+]<br />
URL: [+file_url+]<br />
IPTC Caption: [+iptc:caption-or-abstract+]<br />
IPTC Keyword: [+iptc:2#025,single+]<br />
EXIF Artist: [+exif:Artist+]
</td>
</tr>
Row Close part: (leave this empty)
Close part:
</table>
That will give you a table with two rows, one for the image and one for the information. The “File Size” entry assumes you have created a custom field to hold the file size for each image. To use this template in a post, enter your shortcode as something like this:
[mla_gallery ids=123 columns=1 size=full link=file mla_markup=table]
For your reference, here is a recent topic with more details on how to create custom fields and custom markup templates:
Replace MIME-type Icons in [mla_library] with Images
I hope that gives you the information you need to create the posts and information you want without requiring you to add PHP code to your theme. I am marking this topic resolved, but please update it if you have problems with this approach or more questions about it. I will give you whatever help I can to get the results you want.