Jump to content
Sign in to follow this  
monk22

Changing widget title style without affecting the other widget titles

Recommended Posts

monk22

Hi guys, Been trying to do this all day with no luck - started at 8am it's now nearly 5.30. I'm trying to change one widget title size and alignment without affecting all the other widget titles on my page (my widgets being content side bars). The problem is that the "class" attribute for the widget title I want to change is the same as the class attribute for every single one of the other widget titles - i.e. its always class="widget-title". This means if I put any custom css for the "widget-title" it changes all the other widget titles as well. Is there a way of selecting an element by the plain text it uses - i.e. the actual content on the site? I've tried but I don't think I can. The only other solution I can see is to actually modify this particular widget title to a unique class but I'm wary of mucking around inside the html coding of the framework. I find it a bit wierd that pagelines has attributed every widget title the same damn class or id. Any suggestions? I'm working on a local server right now and so don't have the link but can through up some screenshots if that will help. Chris

Share this post


Link to post
Share on other sites
monk22
F'ing YES!! Just worked it out after reading this article: http://www.jeremyyoung.ws/77/how-to-add-style-to-your-text-widgets-in-wordpress/ If anyone is curious or trying to work this out, the widgets are uniquely identified by the widget "text number" in the source code which you'll find as something like "text-2". So the css you need to put in is: #text-(and then put in the number) .widget-title { then put in all your attributes; } So mine looks like this now: #text-2 .widget-title { color: red; float: right; } If you put a comma between the text number and widget title then that tells the computer that you want them both to be affected by your code but if you don't put a comma in between then it says you only want the title to be affected. So effing happy right now!!! :-)

Share this post


Link to post
Share on other sites
Rob
Sounds like you supported your issue quite well! Bravo! I edited your post to remove foul language and accepted your own answer.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×