Resolved

Controlling column width for widgets in in footer

Ultra Theme started by jfcyr Dec 3, 2019 23 replies
jfcyr Dec 3, 2019 · 2:03 pm #13607

Hello
I am working on updating our site’s footer. I will need to add a logo to the footer.
I currently have the following widgets:
-Image (new widget to display logo)
-Editor (EN)
-Editor (FR)
-Social media
As I have 2 editor widgets (one displaying French and the other one displaying English), my widget count is at 4 and the “columns” are at 25%.
The problem is that my Editors are limited horizontally and that the text now wraps whereas my social media icons widget has too much space around it.
How do I control the width of the different columns so that I can tweak the appearance of my footer ?

Andrew Misplon Puro Dec 3, 2019 · 4:13 pm #13608

Hi 🙂

Please, try something like the following and let me know how it goes:

@media (min-width: 769px) {
	.site-footer .footer-main .widget {
		width: 20% !important;
	}
}

Adjust the value as required.

jfcyr Dec 3, 2019 · 4:34 pm #13609

Hello
It works… but it’s not quite right.
30% is about right for the English footer, but the French text is longer than the English and still wraps.
If I increase the value to 40 % French text is ok but now the social media icons move below the image…
Is there a way to control all the elements of the footer individually, so that the image takes about 40%, the text 40% and the social media 20%?

Andrew Misplon Puro Dec 8, 2019 · 11:07 am #13629

This reply has been marked as private.

Andrew Misplon Puro Dec 8, 2019 · 11:24 am #13631

Sure, we can set the width independently and per language. Please, try the following and adjust as required.

html:lang(fr-FR) #colophon .widget:nth-of-type(1) {
	width: 25%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(2) {
	width: 25%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(3) {
	width: 25%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(4) {
	width: 25%;
}

html:lang(en-US) #colophon .widget:nth-of-type(1) {
	width: 25%;
}

html:lang(en-US) #colophon .widget:nth-of-type(2) {
	width: 25%;
}

html:lang(en-US) #colophon .widget:nth-of-type(3) {
	width: 25%;
}

html:lang(en-US) #colophon .widget:nth-of-type(4) {
	width: 25%;
}
Andrew Misplon Puro Dec 8, 2019 · 11:25 am #13632

If for example, French has two widgets only then you’d remove:

html:lang(fr-FR) #colophon .widget:nth-of-type(3) {
	width: 25%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(4) {
	width: 25%;
}

As you don’t need to target the third and fourth widget.

jfcyr Dec 9, 2019 · 4:24 pm #13648

Hello Andrew
I am using :

/*largeur des éléments du footer */
html:lang(fr-FR) #colophon .widget:nth-of-type(1) {
width: 35%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(2) {
width: 40%;
}

html:lang(fr-FR) #colophon .widget:nth-of-type(3) {
width: 25%;
}

html:lang(en-US) #colophon .widget:nth-of-type(1) {
width: 35%;
}

html:lang(en-US) #colophon .widget:nth-of-type(2) {
width: 40%;
}

html:lang(en-US) #colophon .widget:nth-of-type(3) {
width: 25%;
}

I have removed the code for the 4th footer element in both languages and adjusted the width to what I thought would be suitable, but It does not seem to have any effect on the width of the footer elements. See here on our dev site:
http://oby.454.myftpupload.com

Andrew Misplon Puro Dec 9, 2019 · 7:59 pm #13650

Thanks for the feedback. It looks like a rule applied elsewhere in Custom CSS is dominating:

@media (min-width: 769px) {
  .site-footer .footer-main .widget {
    width: 20% !important;
  }
}

If you remove the above, the new rules targetting each widget should work.

jfcyr Dec 9, 2019 · 8:27 pm #13655

Hello
You are correct. But I still cannot have the 3 widgets be on one “line” .
I have reduced the width of the first two widgets to the point that my text (middle widget, now wraps) but the right widget will not move in line with the others…:
html:lang(en-US) #colophon .widget:nth-of-type(1) {
width: 25%;
}
html:lang(en-US) #colophon .widget:nth-of-type(2) {
width: 25%;
}
html:lang(en-US) #colophon .widget:nth-of-type(3) {
width: 50%;
}
Widget no 2 has a French variant so in total I have 4 widgets, but with that code i am only controlling 3 widgets. Can that be the problem ?

Andrew Misplon Puro Dec 9, 2019 · 8:32 pm #13656

Could you perhaps show me the dev site without the below rule added to Custom CSS so I can see what’s happening:

@media (min-width: 769px) {
  .site-footer .footer-main .widget {
    width: 20% !important;
  }
}

I’m still seeing the above rule added.

jfcyr Dec 9, 2019 · 8:34 pm #13657

It is already removed.

jfcyr Dec 9, 2019 · 8:35 pm #13658

I have re-saved the CSS

Andrew Misplon Puro Dec 9, 2019 · 8:36 pm #13659

Is there perhaps caching in place? I still see the rule, even in private browsing mode.

jfcyr Dec 9, 2019 · 8:38 pm #13660

Not that I know… I have flushed the cache in the backend and in the “Managed WordPress” GoDaddy utility…
No change

Andrew Misplon Puro Dec 9, 2019 · 8:40 pm #13661

Sorry, there is 2.5% x 2 margin to account for so please, try making your total 95%. Make the third-widget in English 45%.

jfcyr Dec 9, 2019 · 8:46 pm #13662

GOT IT !
It seems to work as intended now !
BTW there is a strange behaviour with the Custom CSS plug-in where you loose the “Save” button and have to click on the Custom CSS text in the left pane to regain it. You would not know anything about that would you ?

24 posts