• Resolved cristiano771

    (@cristiano771)


    Hi!
    I have a question about using mla_gallery with a responsive number of columns. I set 4 as default setting for columns number. How can now force the gallery to show only 1 column for mobile device?
    Thank you,
    Cristiano

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cristiano771

    (@cristiano771)

    I have partially solved with this coding:

    [mla_gallery my_custom_sql="attachment_tag=wide orderby=date order=DESC"  mla_link_href='{+site_url+}/{+parent_name+}/' mla_style="responsive" posts_per_page=8  columns=0 size="thumbnail"]
    <div style="clear: both; float: left">
    [mla_gallery my_custom_sql="attachment_tag=wide" posts_per_page=8 mla_output="previous_page,first" mla_link_text='← Pagina precedente' mla_rollover_text="Pagina precedente"]
    </div>
    <div style="float: right">
    [mla_gallery my_custom_sql="attachment_tag=wide" posts_per_page=8 mla_output="next_page,last" mla_link_text='Pagina successiva →' mla_rollover_text="Pagina successiva"]
    </div>

    And

    <style type="text/css">
    #[+selector+] {
        text-align: center;
        margin: auto;
    }
    #[+selector+] .gallery-item {
        display: inline-block;
        margin: auto;
        padding: 5px;
        height: auto;
        text-align: center;
    }
    #[+selector+] .gallery-item .gallery-icon img {
        display: inline;
        margin: auto;
        border: 0px solid #ffffff;
        max-width: 180px;
    }
    #[+selector+] .gallery-caption {
        visibility:none;
    }
    /* see mla_gallery_shortcode() in media-library-assistant/includes/class-mla-shortcodes.php */
    </style>

    Could be possible to have a 2 columns gallery on mobile?
    Thank you again,
    Cristiano

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for the work you put in to finding a solution and posting your progress. As you have discovered, the solution for this type of requirement lies in custom CSS styling. Here is an earlier topic that you can adapt for your needs:

    Can the gallery be made responsive?

    The solution there uses the max-width: qualifier to change the styles based on screen width and the width: style to adjust the number of “columns” (items per row).

    I hope that gets you started on a solution for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the solution proposed in the earlier topic. Thanks for your interest in the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Responsive number of columns’ is closed to new replies.