“Now come on, how hard can this be?” After searching the web for 2 hours now I finally got my answer and you would think it would be quick and easy to find. Oh, sure it is for you now… lol… Since I am writing this
The code for Centering a title when using the Text Widget in WordPress is extremely easy if you use Arras or any theme with a user.css. What this does is overwrite any instructions in the theme. So, how does this make it easier, well all you have to do in Arras is edit the user.css with the following code:
.widgettitle { text-align:center; }
See how easy that is, piece of cake. Now let say we didn’t have this nifty user.css, well then we would have to open some sort of file manager at our hosting site and either download the default.css, edit it, and then upload it or, depending on your provider, right click and select an editor.
For example, I use Hostgator. I went to my cpanel and opened File Manager. Then I had to navigate to my default.css. To do this, I followed the following path: public_html folder, then wp-content, then themes, then arras, then css, and finally selected styles which contained my default.css. I right clicked on it and selected code edit. I scrolled down until I found .widgettitle and added the following code
text-align:center;
So there you have it, pretty easy if you have a user.css, if not, well it may take a little longer.
Best of luck,
JD
JD I am a self professed coding moron. I was half afraid to try this,but I am happy to say that it worked on the first try. At first I was not sure if you meant add that whole code or replace the existing .widgettitle with the .widgettitle { text-align:center; } . I assumed it was the latter and it worked like a charm. Thanks a ton man it looks 10x better to have those centered.
Benjamin Bellville recently posted..How to Get Gardening Product in Manchester Nh
Glad to help and thanks for taking the time to leave a comment
Any idea what the HTML would be to center the whole widget and not just the title?
Most of the time you can simply use
center /center
however sometimes that will not work, especially if you are dealing with a larger widget than the size of your box, so what I do is re-size the widget with something along the lines of width=”270″ height=”250″ Hope that makes sense.i need help i am using foundation theme on my site i cant find the .css file i edit me .css of theme but that aligning code isnt there. pls help
I am not familiar with that theme and I haven’t been coding for a while and have forgotten a lot, however, if that theme has an over-riding .css like Arras then you should just be able to add that code, however if it does not then you must find your default .css and that sometimes can be a pain. Sorry I don’t know more your theme, you might try some type of forum associated with your theme. Best of luck.
I love simple, no-BS solutions like this. Well done!