• Resolved korinthe

    (@korinthe)


    Hello,

    From the MLA documentation it seems possible to use meta_key/meta_value and a custom field to define the destination of mla_link_href, image by image. However it’s not working…. might just be a syntax error? If someone knows how to do this, I’d be grateful.

    I defined my custom field, sponsor_url, with values e.g. “https://www.foo.com” which differ for each image in the gallery.

    When I try the following, I get my page’s url with “meta_value” appended to it:
    [mla_gallery attachment_tag=auction17_gold mla_caption="{+title+}" columns=1 size=medium meta_key=sponsor_url mla_link_href=meta_value]

    When I try mla_link_href="{+meta_value+}", I get my page’s url with [+meta_value+] appended to it…

    All the examples I have found use meta_value in the context of “order_by”. Hoping that is not its only valid use….

    Thanks,
    C

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for posting the full text of your shortcode; very helpful.

    The meta_key and meta_value parameters are only used for the orderby parameter; they conform to the way WordPress implemented the orderby feature. To use custom field values in other MLA contexts you must follow the instructions in the “Field-level Substitution Parameters” section of the Settings/Media Library Assistant Documentation tab.

    In particular, the custom: prefix gives you access to the custom field values. I believe your specific shortcode should be coded like this:

    
    [mla_gallery attachment_tag=auction17_gold mla_caption="{+title+}" columns=1 size=medium mla_link_href="{+custom:sponsor_url+}"]
    

    I am marking this topic resolved, but please update it if you have problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.

    Thread Starter korinthe

    (@korinthe)

    Thanks! Works perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using meta_value in mla_link_href?’ is closed to new replies.