• Resolved FunnyBunnyHelena

    (@funnybunnyhelena)


    Hello!

    Here I am again.

    I would like to have a tiny gallery on the frontpage, with let’s say, the latest 5 photos of one specific attachment_tag.

    I have tried to look in the documentation but I have been unable to find the total number code.

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

    (@dglingren)

    Good to hear from you again – thanks for the question.

    The parameter you want is given in the “Pagination Parameters” section of the Settings/Media Library Assistant Documentation tab. You can add either numberposts=5 or
    posts_per_page=5 to limit the number of items shown in the gallery. Your shortcode would look something like:

    [mla_gallery attachment_tag=my-tag orderby=date order=DESC numberposts=5]

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

    Thread Starter FunnyBunnyHelena

    (@funnybunnyhelena)

    Thank you!!

    Thread Starter FunnyBunnyHelena

    (@funnybunnyhelena)

    Hello again!

    I have thousands of pictures of the tag I want to show from, and it is brutally slow, so the main page takes minutes to load.

    Are there any way to speed this up, considering that I am only needing the latest 5, so to say.

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the update and the follow-on question.

    MLA uses the WordPress database query functions, and the taxonomy queries can be very slow on larger sites such as yours. You might be able to improve things by installing and using the “MLA tax query Example” plugin developed for several earlier topics such as this one:

    Slow queries

    To get the example plugin, navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “SQL” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “MLA tax query Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate the example plugin as you would any other plugin. Make sure you have the latest version, 1.10, installed.

    Once the example plugin is installed and active you can modify your [mla_gallery] shortcode to use the alternate SQL query. Your shortcode would look something like:

    [mla_gallery my_custom_sql="attachment_tag=my-tag" orderby=date order=DESC numberposts=5]
    

    You can also try moving the sort criteria inside the my_custom_sql parameter, i.e.:

    [mla_gallery my_custom_sql="attachment_tag=my-tag orderby=date order=DESC" numberposts=5]
    

    The change is small; move the closing quote from my-tag to DESC.

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

    Thread Starter FunnyBunnyHelena

    (@funnybunnyhelena)

    Oh wow that SQL plugin was SPEEDY!!! THANK YOU! This solves some of my other problems. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Gallery – Only showing latest 5 photos’ is closed to new replies.