wizzud
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Import settings for new installsThanks, good idea! I’ll look into it.
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Possible to limit number of links shown?Hmmm… No, there’s nothing currently in CMW’s configuration that allows you to set a maximum number of menu items to output. Interesting though; I’ll have to think on that.
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Two menus on single pageCan you please show me the shortcode equivalent for the modified Now menu (it should now have an Alternative configured)?
Can you confirm that you now only have one active CMW instance – the Now menu? (ie. the Courses menu widget is inactive)
And can you confirm that this is what you want to do (same as before but re-worded) :
“If the Now item, or any of its descendants, is the current item then show the Now menu. Otherwise, show the Courses menu.”NB : the Courses menu will contain the Now items – unless you’ve specifically excluded them. And you may have a condition on the Courses menu such that you only want to show it if it contains the current item. Neither of these would affect the Now menu or its condition for switching to the alternative.
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Two menus on single pageUsing widgets…
- Configure a widget to show the Courses menu
- Copy the equivalent shortcode
- Move that widget into Inactive Widgets
- Configure another widget to show the Now menu
- In the Alternative section of the Now menu widget :
- Set the condition as Current Item NOT in Primary Filter
- Paste the copied shortcode (from the Courses menu widget) into the text box
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Not showing subpagesOkay, good.
(posting at the same time!)Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Not showing subpagesHope this is now clear
No, not really.
That – and the subsequent example – tells me what you are aiming for … which is easily achievable.
What it doesn’t do is give me any clues as to why you seem to be having such a problem getting there!If CMW is a suitable choice of widget – and I have seen nothing in terms of menu structure to indicate whether it is or isn’t – then the configuration you have set should do what you want. But the output you are showing me does not seem to relate back to the CMW configuration, and you aren’t giving me enough information for me to be able to help! At the moment, I can’t even be sure that the output you’ve show me actually comes from a CMW instance!
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Not showing subpagesWith this configuration…
[cmwizard menu=NN title=”cmw” branch=current depth=2 ancestors=1 siblings=1/]
(I’ve left out
contains_current="menu"
because it has no effect here)
…you should not be seeing either am1 or am3 if you are on bmm1 (because neither of them is either a sibling or ancestor of bmm1).You’ve answered one of my questions: “bbm1” should be “bmm1”. Any response to the others?
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Two menus on single pageOh bums! I’m really sorry, I missed this for some reason!
Have you resolved this, or is it still a problem?I’m guessing that when you’re on a Now (or lower) page, you don’t want to see the Courses Menu?
If it is still an issue, a possible way to resolve it might be to set Courses as an alternative to Now, conditional upon the current item not being in the primary filter.
Eg : “show me Now and all descendants unless I’m not on a Now (or lower) page, in which case show me Courses and all descendants”.
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Not showing subpagesYour setup is asking for :
"the current item and its immediate children, plus its siblings, and its ancestors back to root level"
You have shown me 2 outputs … and they are exactly the same as each other.
Neither of those outputs contains a “bbm1” item … which is confusing.
The first output doesn’t tell me which page you’re on that produces that output. And for the second one you’ve given me a page that isn’t in the output.If I assume that the output you’ve shown is an accurate reflection of (at least part of) your menu#2 structure – ie. menu#2 has a root-level item ABC, ABC has 3 child items (am1, am2 & am3), am2 has 2 child items (bmm1 & bmm2) – then the output shown, with the configuration you’ve supplied, is what I would expect to see if am2 was the current item.
If any other item was the current item – ABC, am1, am3, bmm1, or bmm2 – then CMW would/should not produce that output, for that menu, using that configuration.So…
What is the actual menu structure of menu#2?
Where does the “bbm1” item fit in?
What page produces the first output you’ve given?
Does the output ever vary (depending on which page you’re on)?
Is the output actually being produced by CMW?
Do you have a web-accessible site that I can look at this on?Forum: Plugins
In reply to: [Custom Menu Wizard Widget] PHP7 supportIt will.
You’re welcome. And thank you!
Right…
The theme hooks into WordPress’s wp_nav_menu_args filter and, unless the menu being produced has a
menu_id
of “mobile-menu”, changes the “walker” to its own.WordPress has a
Walker
class that is a general class for producing lists (which is all a menu is). WordPress also has aWalk_Nav_Menu
class, which extends theWalker
class specifically for menus. Usually plugins will provide their own “walker” as an extension of the WordPressWalker_Nav_Menu
class. This is exactly what CMW does : it uses its own extension of theWalker_Nav_Menu
class to do the filtering and set extra classes.
However, because your theme is intercepting every production of a menu and changing the requested “walker” class to its own, the CMW one never gets called. You’d probably find that other menu plugins (that have their own “walker”) would have exactly the same problem.The theme code responsible can be found in
tower/includes/core/codeless_megamenu.php
, as part of thecodeless_custom_menu
class. The class is included into, and instantiated by, the theme’sfunctions.php
as part of the theme setup. With the sole exception of the mobile menu that activates from the burger button (when the screen is small enough), every menu produced using WordPress’swp_nav_menu()
function will use the theme’s “walker”. (And even the exception isn’t really an exception : it’s just configured to use another of the theme’s “walkers”.)I can guess what your next question will be : Is there a way around it?
By modifying CMW : No.
By modifying your theme : Yes. Add a check for $args[‘_custom_menu_wizard’] before deciding to switch over to the theme’s “walker”. However, this would be a change to the theme’s core code, and it would be lost (or would have to be re-applied) whenever the theme got updated! I would not advise changing any theme’s core code. If you have a child theme then that might be a different matter, but it would still mean that any theme update would have to be checked against your child theme modifications to ensure compatibility.My suggestion : try dumping it in the theme provider’s lap?
I hope this helps.
Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Displaying 1 level above and 1 level below.I’m very sorry, but I either didn’t get notified of the your last response, or I missed it (probably the latter).
Is this still an issue, or have you many to resolve it?Yes, the same mechanisms that CMW uses to provide its functionality can be used by other plugins and themes as well. And they can get in each others way!
Is your theme a commercial one, or a free one? If it’s free, I can download it and see if I can find what’s occurring. Either way, it might be a good idea to put the question to the theme provider?
PS : It might be a good idea to re-enable your other plugins first, just to check that is really the theme and not one of those other plugins.Forum: Plugins
In reply to: [Custom Menu Wizard Widget] Show menuConfigure a widget for the menu that you want to see when current page is NOT part of the menu.
Copy the equivalent shortcode that the widget produces for you.
Now configure the widget – or use another widget instance – for what you want to see when the page IS part of the menu.
Look at the ALTERNATIVE section : paste your previous shortcode into theThen switch settings to
textarea, and set theON Condition
pair of SELECTS to Current Item is NOT in… Menu