Categories
Web Design Web development

Theming WordPress plug-in content

I have to say that I really like the delicious plugin (del.icio.us for WordPress, by Ricardo Gonzalez), but it didn’t quite look right in the Constructor theme that I am using. The heading didn’t match the rest of the theme headings, and there was text following the link names specifying when the link was posted, but it was indistinguishable, i.e. same style.

(Delicious.com, or del.icio.us,  is a social bookmark site, you can save bookmarks to the cloud and share them with your friends.  You tag the links, they’re searchable, your list of links is browsable, and the ability to access that cloud on your blog is a great little feature.)

Turns out when you look at the source code generated by the widget, it does have custom classes for these elements:

Delicious_title_link   -- the actual title used in the sidebar
Delicious-item    	--  the specific link list item
Delicious-link     -- the link itself
Delicious-timestamp  -- the time for the item (e.g. “36 mins ago”)

Fortunately, Constructor lets you add your own CSS rules to the theme in a separate CSS file that won’t be overwritten when you update the theme files. This is a great place for adding the rules you need.

So, I added the following to the css file, just to differentiate that time stamp with smaller italic text in a contrasting color, and to make the title link look like the other sidebar headings:

.delicious-timestamp {
font-size: smaller;
font-style: italic;
color: #2F608A
}

.delicious_title_link {
color: #2F608A;
}

Voila, now things match, and if I should build my own custom theme from scratch later, I can just lift these rules to accommodate that widget, or any other widgets with their own CSS classes.