• There is a error in the code at line:3 What is it?

    syntax error, unexpected ‘.’, expecting end of file

    /* Adds an arrow next to menu items with sub menus */
    /* You will most likely need to adjust this per site ~~~~~~~~~~~~~~~~~~~~~ */
    .fusion-flyout-mobile-menu .menu-item-has-children > a span::after {
        content: '\e61f';
        display: inline-block;
        font-family: icomoon;
        font-size: 18px;
        width: 18px;
        line-height:35px;
        color:#fff;
        position: static;
    	margin-left: 1em;
    }
     
     
    /* These will most likely be fine as they are ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* Theis makes it so you can't scroll away from the menu and search icons */
    .fusion-flyout-active .fusion-header-has-flyout-menu-content {
        position: fixed;
        width:calc(100% - 60px);
    }
     
    /* This makes the current nav item open by default */
    .fusion-flyout-mobile-menu.fusion-mobile-nav-holder .menu-item-has-children.fusion-mobile-current-nav-item .sub-menu {
    	display: block;
    }
    • This topic was modified 3 years, 9 months ago by martini0.
    • This topic was modified 3 years, 9 months ago by martini0.
Viewing 12 replies - 1 through 12 (of 12 total)
  • 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?

    Thread Starter martini0

    (@martini0)

    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

    Thread Starter martini0

    (@martini0)

    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.
    Dion

    (@diondesigns)

    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…

    Thread Starter martini0

    (@martini0)

    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.

    Thread Starter martini0

    (@martini0)

    Thread Starter martini0

    (@martini0)

    The css part is working now 🙂 but how do i do javascript?

    Thread Starter martini0

    (@martini0)

    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();
        });
    }
    Dion

    (@diondesigns)

    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.

    Thread Starter martini0

    (@martini0)

    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.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘New PHP code error’ is closed to new replies.