Hi @martini0
The code you have shared is css code. Can you share php code or website link having above error ? so i can check for you in detail
Thanks
Hi there,
The code you provided looks like it’s from the theme you are using not WordPress core files. On this forum, you can only get assistance with issues that arise from WordPress core files.
Can you please check the theme you are using, and reach out to their support so that the developers can have a look and advise what the issue is.
Is there anything that isn’t working on the site that you believe is related to the WordPress core files?
Oh sorry about that, it is indeed Css. I am trying to make the submenus visable on my flyout menu. The link to do it is here.
https://snippets.cacher.io/snippet/ca1e6113238f63163ac4
This was the PHP code with an error. Line 5
syntax error, unexpected ‘(‘, expecting variable (T_VARIABLE) or ‘{‘ or ‘$’
//enable child menu items on mobile flyout menu (works like an accordion element)
//Must be inside an on ready function
function menuSetup() {
//enable child menu items on mobile flyout menu (works like an accordion element)
$('.fusion-flyout-menu .menu-item-has-children > a').click(function(e) {
e.preventDefault();
$('.fusion-flyout-menu .menu-item-has-children.open > .sub-menu').not($(this).next('.sub-menu')).slideUp();
$('.fusion-flyout-menu .menu-item-has-children.open').not($(this).parents('.menu-item-has-children')).toggleClass('open');
console.log($(this));
console.log($(this).parents('.menu-item-has-children'));
$(this).parents('.menu-item-has-children').toggleClass('open');
$(this).next('.sub-menu').slideToggle();
});
}
-
This reply was modified 3 years, 9 months ago by
martini0.
That’s javascript, not PHP. Since you don’t seem to know the difference between CSS, javascript, and PHP, perhaps you would be better off hiring someone to do this for you…
I understand your point, but I do know the difference between css & the other 2. However, I am no programmer.
Could you tell me how I can enable submenus on my flyout menu? I use Avada.
The css part is working now 🙂 but how do i do javascript?
I found where to place the Javascript. But its not working. Does anybody know how to fix it?
function menuSetup() {
//enable child menu items on mobile flyout menu (works like an accordion element)
$('.fusion-flyout-menu .menu-item-has-children > a').click(function(e) {
e.preventDefault();
$('.fusion-flyout-menu .menu-item-has-children.open > .sub-menu').not($(this).next('.sub-menu')).slideUp();
$('.fusion-flyout-menu .menu-item-has-children.open').not($(this).parents('.menu-item-has-children')).toggleClass('open');
console.log($(this));
console.log($(this).parents('.menu-item-has-children'));
$(this).parents('.menu-item-has-children').toggleClass('open');
$(this).next('.sub-menu').slideToggle();
});
}
Avada is a premium theme, and support for premium themes on wordpress.org is not allowed.
You should ask your question wherever Avada is supported.
Dion doesn’t sound Russian. Are you sure your name is not Sergey?
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Dion doesn’t sound Russian. Are you sure your name is not Sergey?
I’ve no idea what that means but Dion’s right.
For pro or commercial product support please contact the developer directly on their site. This includes any pre-sales topics as well.
https://theme-fusion.com/support/
As the developer is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.