Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   How to: Styling Current Page Differently in Menu (http://forum.bytesforall.com/showthread.php?t=19458)

jerryc Jan 25, 2013 06:13 PM

How to: Styling Current Page Differently in Menu
 
1 Attachment(s)
Note: I'm using vertical custom menus, so this may work differently in navbar menus.

Out of the box, in custom menus in MZ, if there's a link to the current page, it will be active. I found a plugin called Remove Redundant Links, that did part of what I wanted. Instead of being a link, a link to a current page would be removed, and a title "You Are Here" would appear. The styling stayed the same.

I wanted more. So, I went to the plugin's page and under that plugin clicked edit. Then, I selected the bottom file, remove-redundant-links/class.Remove_Redundant_Links.php. About 2/3 of the way down, I commented out this code:

PHP Code:

/*            // Set title.
            if ( ! $this->settings['title'] )
            {
                unset ( $attr_arr['title'] );
            }
            else
            {
                $attr_arr['title'] = $this->settings['title'];
            }
*/ 

Then, to make the current item in the menu show differently and act more like a breadcrumb, I added the following CSS:

Code:

ul.menu li.active,
.menu li a.current_page_item,
.menu li a.current_page_item:hover
{
color: #D14200;
font-weight:bold;
border: none;
background: #FFFFFF;
}

Here's the example.


All times are GMT -6. The time now is 03:53 AM.

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