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

    (@dglingren)

    Thanks for an interesting application question. You can accomplish your goal with a bit of PHP code that divides the overall query into separate queries for each term and then combines the results.

    I have uploaded a new MLA Development Version dated 20160804 that contains a new example plugin with the required code. It also contains a completely new way to find and install example plugins, which I would love your feedback on. To get the Development Version, follow the instructions in this earlier topic:


    Shortcode not working in (special) widget

    It would be great if you can install the Development Version and let me know how it works for you.

    To find the example plugin, navigate to the Settings/Media Library Assistant Documentation tab and click the new “Example Plugins” button. Enter “multi” in the text box and click “Search Plugins”. You should see two example plugins.

    The “MLA Multiple WP Query Example” plugin is the one you want. You can hover over the plugin name and click the “Install” rollover action to add it to your site. Then, go to the Plugins/Installed Plugins admin submenu, find the plugin and activate it.

    Once the example plugin is activated you can modify your shortcode to be:

    [mla_gallery multi_wp_query="gallerytags=flowers,plants,trees,nature"  mla_markup=my-markup-slider numberposts=1 orderby=date order=DESC]

    The changes are:

    1. The gallerytags taxonomy query has been changed to use the example plugin’s new parameter.
    2. The numberposts parameter has been changed; it applies to each of the four separate term queries.
    3. The orderby=date and order=DESC parameters have been added to select “the latest” item in each term.

    You can inspect (or modify) the plugin code by clicking the “Download” rollover action to get a copy on your local system. You can find more information in the “The Example Plugins” section of the Documentation tab.

    I look forward to your comments on the new MLA features and the example plugin. I will leave this topic unresolved until I hear back from you.

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA version 2.32, which contains the new example plugin required to support your application.

    I am marking this topic resolved, but please update it if you have problems or further questions regarding how to use the example plugin in your site. Thanks for your interest in the plugin.

    Thread Starter Thor Sarup

    (@mouret)

    sorry, I didn’t get back on this – works perfectly ?? and thanks for such a quick response and development!

    Thread Starter Thor Sarup

    (@mouret)

    Related to the solution above – how can I link to the category which the image belongs to? So, instead of linking to larger image I want it to go to my “flowers” category, when I click the (latest) flower image. I guess it should be a tag in the markup, but is it possible?

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the good news about your success with the example plugin.

    You wrote “how can I link to the category which the image belongs to?“. I understand that to mean you want to link to a “Category archive page” that allows you to see all the images assigned to a specific term. That is a simple question with a complicated answer, and it has come up before:

    404 for attachment_category pages

    That topic points to a longer explanation in:

    Att Categories menu returns 404 error

    which in turn links back to several even older topics. As you can see, this is a popular question!

    The quick answer can be found in my second post in the longer topic:

    mla_gallery in combination with the mla_tag_cloud

    You can start there, then browse the other material to get a better understanding of the issues involved. Post an update here if you have problems or further questions regarding the “cloud and gallery” suggestions in the earlier topics. I hope that helps you find a solution that works in your application.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘mla gallery – with latest image from four categories?’ is closed to new replies.