Thanks for the positive feedback; I am happy that the plugin is a time-saver for you.
I hope I understand your question, based on your phrases “automatically link it to the page it is attached to” and “link each image to its page“. I understand that to mean that you want to compose a [mla_gallery]
with one or more images and make the link for each gallery item go to the post/page which is the “parent” of the item, i.e., the post/page the item is “attached to”. Is that right?
If that’s the question, you can accomplish your goal with some of the “Gallery Display Content” parameters. For example:
[mla_gallery post_parent=any mla_caption="{+parent_title+}" mla_rollover_text="Go to: {+parent_title+}" mla_link_href="{+site_url+}/?p={+parent+}"]
In this example, post_parent=any
selects all items that have a non-zero parent. You can replace this with any item selection parameters you need. The mla_caption
and ‘mla_rollover_text` parameters display the title of the parent post/page so the destination is obvious. Again, substitute anything that makes sense in your application.
The mla_link_href=
parameter is the key. In this parameter. {+site_url+}
is replaced by the root URL for your site. The /?p=
says “go to the post/page with this ID” and {+parent+}
is an attachment-specific substitution parameter that contains the post_parent ID.
As you can see, no custom fields are required for this solution. If I’ve missed something in your question, give me more details and I can be more helpful.
I’m going to mark this topic resolved, but feel free to update it if you have any problems or further questions. Thanks for your interest in the plugin.