meandrewdunn
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How do I set up conditional "Current-Menu-Item" id attributes?Thanks all for your wonderful help. Funny, I checked my code again with an HTML inspector and saw the “current-menu-item” id was added to the menu item.
“It seems like it would work, but I placed it in the function.php and nothing happened. Is there a specific location/line to feed it?
Thanks in advanced and for all your help.”
You were totally right. I hope this thread will help anyone looking to resolve this issue. I know it helped me. You were a life saver 🙂
Forum: Fixing WordPress
In reply to: How do I set up conditional "Current-Menu-Item" id attributes?It seems like it would work, but I placed it in the function.php and nothing happened. Is there a specific location/line to feed it?
Thanks in advanced and for all your help.
Forum: Fixing WordPress
In reply to: How do I set up conditional "Current-Menu-Item" id attributes?I believe the script your provided would set up a condition that would call a css style into play and highlight menu item 175. Which would work.
However, I am curious if there is a way to assign a class to the menu item in the same way? Because I wanted to assign the id=”current-menu-item” to menu item 175 when a post from a specific category is viewed.
There is a javascript menu animation that I liked, but requires the “current” id to initiate.
Forum: Fixing WordPress
In reply to: How do I set up conditional "Current-Menu-Item" id attributes?Well, I wanted to test out what you said, so I switched my theme to twenty 11, and the menu items aren’t tagged with the “current-menu-item” id and aren’t highlighted when viewing this post:
http://iamandrewdunn.com/2011/08/our-apples-go-to-11-see-how-ifix-the-ios-volume-controls/
When viewing the post (and all posts in its category) I would like the menu item “8-bit Human” to be highlighted.
Forum: Fixing WordPress
In reply to: How do I set up conditional "Current-Menu-Item" id attributes?A link won’t help.
There should be a template method where I could place some code in the functions.php file:
i.e.:
“if posts, get_postcategory, if(postcategory (‘category here’), assign current-menu-item_id (‘blog’)” – where “Blog” is the menu item that I’d like highlighted. I have no idea how it would really be coded, which is why I am asking.Currently, if you were to select a post, then no menu item is highlighted.
I would assume the script would go in the functions.php file in the template’s directory.
SAME. They likely know about this by now.