Skip to content

Instantly share code, notes, and snippets.

@marklchaves
Last active June 29, 2020 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklchaves/71c5b72a4e106970a14cd6c6b48e6f2d to your computer and use it in GitHub Desktop.
Save marklchaves/71c5b72a4e106970a14cd6c6b48e6f2d to your computer and use it in GitHub Desktop.
WordPress Gallery Shortcode and custom CSS for 4x1 Gallery Alternatives using Avada by ThemeFusion
@marklchaves
Copy link
Author

The tutorial for how to use this code is on YouTube.

@marklchaves
Copy link
Author

Added code to support gutters with or without media query for smaller devices. I originally used 10px gutters to exaggerate the space. But, I eventually switched back to responsive % units.

@bskousen
Copy link

Thx for posting this. Do you know how to get it to work with the events shotdcode? I tried playing around with this code but something is just not aligning right.

@marklchaves
Copy link
Author

marklchaves commented Apr 28, 2020

Thx for posting this. Do you know how to get it to work with the events shortcode? I tried playing around with this code but something is just not aligning right.

Hi @bskousen,

You're welcome. :-)

Sorry, I'm not sure if I know which events shortcode you are referring to. Can you share with me a link to the events plugin and maybe a link to the page you're having the issue with?

Thanks!

Edit: Ah, probably this events plugin. They changed their look! https://wordpress.org/plugins/the-events-calendar/

@bskousen
Copy link

Yeah, I actually contract with them. Re-doing a site now and between their CSS and Avada CSS it seems to have something I am not considering. Here is the URL, I am use the events shortcode and have a 2 column row, mobile only with 0 margin/ 0 padding http://staging.anz.isagenixevents.com/

@marklchaves
Copy link
Author

Hi @bskousen,

Very cool. I hope you are enjoying the project.

Thanks for sharing the link. I see the last set of images in the Follow us panel are all in their own row and floated to the left under one parent Fusion row that contains the heading and the floated individual "mobile rows" for the images.

Since these individual "mobile rows" are floated left to under that parent row, they are left-justified under that row. So, they are slightly off as you noticed.

What's the fix? One way is to make that parent row a flexbox. Here's an example.

/** 
 * Flex Solution 
 * 
 * Try making the parent row of the mobile "rows" a flexbox.
 * You'll need to assign that row an ID or class to be able to 
 * get a handle on it first.
 *
 * <div id="mlc-test" class="fusion-builder-row fusion-row ">
 */

#mlc-test {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
}

See the screengrabs for more details.

Let me know if this works for you.

Screengrabs

Floated left

floated-image-rows

Center justified using flex

flex-solution-results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment