One column galleries

Mauer Themes Support Essentialist One column galleries

Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #1415

    Hi there,

    Thanks again for this theme, I’m still super happy with it.

    I was wondering whether it’s possible to create one column galleries too, instead of the automatically 2-3 photo galleries. This would work out better in the case of photo reports.

    Looking forward to hearing from you,

    Best, Kris



    To be able to create one-column galleries in Essentialist you’ll need to perform the following 5 steps:

    Go to the functions.php file in the theme folder. Find the following line add_image_size( "mauer_thumb_4", 526, 526, TRUE ); (should be around line 150). Insert the following line right after that line (see screenshot):
    add_image_size( "mauer_thumb_5", 1000, 999999, FALSE );

    In the same file, find the following line // just one image in the gallery (should be around line 648). Insert the following 2 lines of code after the block that starts with that line – as you see in the screenshot:

    if ($atts['columns'] == 1) {$class .= ' mauer-enforce-1-col'; $thumb_size = 'mauer_thumb_5';}
    else {$thumb_size = 'mauer_thumb_4';}

    In the same file, find the following line else {$img_reg = wp_get_attachment_image_src($id, 'mauer_thumb_4');} (should be around line 657), and replace it with this:
    else {$img_reg = wp_get_attachment_image_src($id, $thumb_size);}

    Install the Simple Custom CSS plugin. Once you install and activate it, in your Admin Panel please go to ‘Appearance’ > ‘Custom CSS’. There insert the code you see below and save:
    .mauer-enforce-1-col {width: 100%!important; padding-left:0!important; padding-right:0!important;}

    Install the Regenerate Thumbnails plugin. After you install and activate it, go to “Tools” > “Regen. Thumbnails” and regenerate the thumbnails.

    Now if you choose 1 column in the gallery settings (see screenshot), it will be displayed in one column.

    A little disclaimer: It’s best to do such modifications in a child theme, so they do not get overwritten during theme updates. However, of course you can always re-introduce them after a theme update.


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.