Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   Style differently the active (just clicked) link in Categories and other widgets (http://forum.bytesforall.com/showthread.php?t=6067)

ymf Feb 27, 2010 11:17 AM

Style differently the active (just clicked) link in Categories and other widgets
 
Is there a way to style differently the "active" (just clicked) link on WP's "Categories" / "Recent Posts" / "Recent Comments" / "Blogroll" and other rather standard widgets displaying collections of links?

Consider http://wordpress.org/showcase/tag/people/ as a prototype of the desired effect: under the "Popular Tags" in the left column, the link "People" has presently been clicked. Note that "People" is gray and is not clickable. It looks like this:

Popular Tags
CMS (83)
People
Technology (60)

Then, click the blue "Technology (60)" link: it leads to http://wordpress.org/showcase/tag/technology/. Now, "Technology" becomes gray non-clickable, and the link "People (64)" became clickable again:

Popular Tags
CMS (83)
People (64)
Technology

ymf Feb 27, 2010 03:13 PM

I found an answer for "Categories" widget but not for the other kinds of widgets. CSS insert
PHP Code:

li.current-cat a {
    
color:#FF66FF !important;
    
border-left:7px solid #FFDDDD !important;
}
li.current-cat
{
    
color:#66FFFF;
    
background:#EEEEEE none repeat scroll 0 0;


or
PHP Code:

li.current-cat
li.current-cat a {
    
color:#FF66FF !important;
    
border-left:7px solid #FFDDDD !important;
    
background:#EEEEEE none repeat scroll 0 0;


... works for "Categories" widget because the currently chosen list item will have an added class="current-cat" under the "li" element (I guess it's WP's feature, not the themes?).

However the "Recent Posts" / "Recent Comments" / "Blogroll" widgets don't seem to provide any means to tell the currently selected item from the other items on the list (again, I guess it's WP's feature, not the theme's)... Any thoughts?

juggledad Mar 3, 2010 02:58 PM

it falls in the lap of the widget author. If they don't output something unique then there is no way to style it.


All times are GMT -6. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.