Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Sub-menu indicator not working correctly in menus (http://forum.bytesforall.com/showthread.php?t=23358)

cefiar Dec 14, 2015 11:09 AM

Sub-menu indicator not working correctly in menus
 
2 Attachment(s)
Getting a weird issue with menus not working correctly.

Site has a defined menu in Wordpress (WP4.4). Two top level options first up that have no sub-menus, then 3 options that do have sub-menus. Atahualpa is configured to use the menu as the first option.

Issue seems to be that the `rMenu-expand` class gets added to the first menu entry that doesn't contain a sub-item which appears before the menu entry that contains a sub-item (instead of the entry with sub-items). In the case of my site this is the first menu entry "Home".

Site: http://www.hackmelbourne.org (Connected Community Hackerspace in Melbourne, Australia)

Works fine with the twentyfifteen theme, but it doesn't really add a class like this (just sub-items). Have tried with no plugins. Also tried without & in the menu entry title. Also tried recreating the menu entry from scratch. Tried with and without my child theme.

Config attached, but pretty sure this is a code bug. Also attached is a pic of the menu as currently configured in WP. Most items in the menu are Pages, so should be easily reproduced.

FYI: Moving "Blog" after "About CCHS" (and it's sub-items) ends up with a sub-item marker attached to "Blog" as well (the one from "About Rules & Policies" disappears).

dabeed Dec 14, 2015 11:27 AM

I'm getting the same thing. I'm also on WP 4.4, and Ata is up to date. I believe it happened for me right after the 4.4 update.

juggledad Dec 14, 2015 02:03 PM

@cefiar - I can't reproduce it with your export. Mind sending me a PM with an admin id/pw so I can poke about?

EDIT: NEVER MIND - I HAVE REPRODUCED IT. Now let me see hat is happening...

cefiar Dec 14, 2015 04:27 PM

Great to see you've reproduced it.

As @dabeed said, it only seemed to appear once updated to 4.4.

I upgraded my test site first and didn't notice it before I upgraded the live site. I only noticed as I had another tab open from before the upgrade (live site) that I hadn't refreshed.

@juggledad - Many thanks for your time on this. As always, it's appreciated.

juggledad Dec 15, 2015 04:18 AM

The problem is caused by wordpress changing the string the custom menus returned. The good news is (after banging my head on this for a loooooong time) it is a simple fix, so please try this.

edit bfa_new_wp3_menus.php and change line 43 from
HTML Code:

        $newmenu = preg_replace("/<li (.*?)class=\"(.*?)\">(.*?)\n(.*?)<ul class=\"/i","<li \\1 class=\"rMenu-expand \\2\">\\3\n\\4<ul class=\"rMenu-ver ",$newmenu);
to
HTML Code:

        $newmenu = preg_replace("~menu-item-has-children~","rMenu-expand menu-item-has-children",$newmenu);
and let me know if you have any issues

dabeed Dec 15, 2015 11:26 AM

It works (for me)! Thank you so much, Juggledad! You = Da man. : )

One issue:

I have this CSS, for making the menu slightly transparent:
Code:

ul.rMenu-ver {
opacity: .95;
}

But now that code has no effect, and I tried adding !important.

dabeed Dec 15, 2015 12:12 PM

Ok one fix for the issue above is to change the CSS to:
Code:

ul.sub-menu {
opacity: .95;
}

Thanks again, Juggledad!

cefiar Dec 15, 2015 03:26 PM

I agree, you're definitely "Da man" @Juggledad!

Fix is now in and working perfectly!

@dabeed - I might just steal that menu opacity CSS idea. ;)


All times are GMT -6. The time now is 12:48 AM.

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