-
AuthorPosts
-
March 5, 2024 at 5:08 pm #1436388
Hi, I hope you are having an amazing day!
I would like my 1/4 columns to display as 2 Up on mobile instead of being stacked individually on top of each other. I have set up a content slider on the page to show what I would like to accomplish with the column sections. Thank you for your help : )March 6, 2024 at 8:38 pm #1436542Hey envisageiam,
Thank you for your patience, try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:@media only screen and (max-width: 767px) { .responsive #top #wrap_all .flex_column.av_one_fourth { width: 48%; clear: none; float: left; } }
Please note that this will work on all pages on your site, so if you want this to be page specific a page ID can be added to the css, or you can add a custom class to the specific columns and add that to the css. Let us know if you need further help with this.
Best regards,
MikeMarch 6, 2024 at 10:12 pm #1436548Thank you for your help!
That works great for my 1/4 columns, but it breaks my columns where there is only 3 items, on mobile : (March 6, 2024 at 10:28 pm #1436550This reply has been marked as private.March 6, 2024 at 10:33 pm #1436551Hi,
I recommend adding a custom class to the specific columns that you want to be two wide for mobile and then add this class to the css.
In the three wide rows you are also using the 1/4 columns so if you want these to not be changed follow the step above, if you do want them two wide there will be an odd column out as there are only three columns per row, this would be expected.Best regards,
MikeMarch 6, 2024 at 10:34 pm #1436552Ok, how do I add a custom class?
March 6, 2024 at 10:38 pm #1436553What I would like is for everything to be the same 1/4 columns, but when I set the columns to 1/4 and there is only 3 items the the alignment isn’t centered like it is when I set it to 1/3.
March 6, 2024 at 11:47 pm #1436554March 7, 2024 at 12:14 am #1436558This reply has been marked as private.March 7, 2024 at 12:42 am #1436561March 7, 2024 at 1:47 am #1436564This reply has been marked as private.March 7, 2024 at 1:48 am #1436565This reply has been marked as private.March 7, 2024 at 12:14 pm #1436603March 7, 2024 at 4:16 pm #1436644This reply has been marked as private.March 9, 2024 at 3:29 pm #1436811Hi,
Thanks for the screenshot, to make the third items align to the center like that will require some custom css for the dry rubs row and the row above it, is this the final design or is it possible that you will be adding more items making them even rows, in which case there will be no need to customize?Best regards,
MikeMarch 9, 2024 at 5:38 pm #1436821The items vary per location and will need to be adjustable. But at the moment with the provided CSS the page is broken.
March 9, 2024 at 5:41 pm #1436822For example, if you look at the “Sides” section, there is only 2 items and they are not aligning
March 9, 2024 at 6:29 pm #1436825Hi,
For the “sides” section, you have four 1/4 columns, the outer two are empty and the inner two have content:
so on mobile you see:
so you will want to set the two empty columns to not show on mobile at Column ▸ Advanced ▸ Responsive ▸ Mobile display:
I did this for you and now it shows like this:
Best regards,
MikeMarch 11, 2024 at 11:42 am #1436946This reply has been marked as private.March 12, 2024 at 4:18 am #1437008Hi,
Yes the odd items will not center on mobile, this is not the intended behavior of two columns on mobile, we may be able to help you customize for this behavior but you will need to manually do this for each odd item on each page, this is why I asked if this is the final design for the page or if you will be adding more items, because if you add more items you will need to remove the customization to center the odd items, I can show you how so you can do it to your other pages, or do you want to leave them like they are?Best regards,
MikeMarch 12, 2024 at 10:48 am #1437031Ok, can we go ahead and add please and then if you could show me how to edit so they can be updated when items are added or removed : )
March 12, 2024 at 10:27 pm #1437102Hi,
Ok, on your page you have two odd third items, for both of these I added the custom class odd-item
Then I added this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:@media only screen and (max-width: 767px) { .odd-item { position: relative; left: -23%; } }
now on mobile they are centered:
Please clear your browser cache and check.Best regards,
MikeMarch 12, 2024 at 10:35 pm #1437103Thats perfect! Thank you. So if I add/remove an item what do I need to do to keep everything aligned?
March 12, 2024 at 11:57 pm #1437106Hi,
Just make sure that the custom class is only added to the third odd items.
Shall we close this thread then?Best regards,
MikeMarch 15, 2024 at 6:33 pm #1437336This reply has been marked as private.March 15, 2024 at 8:53 pm #1437342Hi,
I believe that I removed the “float” from the css that I gave you earlier, please compare the css from the two sites.Best regards,
MikeMarch 15, 2024 at 9:08 pm #1437345Unfortunately, that didn’t work. I removed from the general styling and it made everything float left.
March 15, 2024 at 10:32 pm #1437347March 15, 2024 at 10:42 pm #1437348Perfect, thank you.
I have one last thing I would like to accomplish. Can you help me create a class to align buttons and images to bottom.
For Example, if you look under “Wings” you will with see that the “Order” buttons are aligning with the above text. Additionally, if you scroll down to the “Sauces” section you will see that the peppers alignment is also relevant to the amount of text above.I would like for the buttons and peppers to align with the bottom of the section so everything is symmetrical.
Thank you for your help. I am new to using classes and your help has been super educational and much appreciated!March 16, 2024 at 1:34 pm #1437361Hi,
First add the custom class specialHeight to each 1/4 column that you want the button the hot pepper image to line up below the special heading.
You don’t need to add this to the third odd item or items with no button or image.
Then typically I would add the following script to the end of your child theme functions.php file in Appearance ▸ Editor, but I see that you are not using a child theme so you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
then add this code and save.function custom_specialHeight_script() { ?> <script> (function($){ $('.flex_column_table').each(function(){ var $specialHeading = $('.specialHeight .av-special-heading',this); var specialHeadingHeight = Math.max.apply(Math, $specialHeading.map(function(){ return $(this).height(); }).get()); $specialHeading.height(specialHeadingHeight); }); var resizeId; window.addEventListener('resize', function() { clearTimeout(resizeId); resizeId = setTimeout(doneResizing, 300); }); function doneResizing(){ location.reload(); } })(jQuery); </script> <?php } add_action( 'wp_footer', 'custom_specialHeight_script', 99 );
I did this for you on your test site.
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.