• Hi,

    Im creating a menu item using a custom link, I’m using javascript:; in the link URL as I don’t want that page to go anywhere. After saving the menu and going back in, I can see the javascript:; has been removed from the URL.

    I’m trying to use javascript:; as currently when logged into the site on a mobile device, the sub menu automatically collapses when its click. It ok on a PC where you have hover over the menu item.

    Im looking to stop sub menus automatically closing when clicked as I cannot access the sub menu items.

    Many thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Roch

    (@rochesterj)

    Hi!

    Thanks for reaching out!

    Please use # as the target and WordPress won’t remove it. I don’t think WP will allow JS in your url as that is prone to XSS attacks

    Thanks!

    Kind Regards,
    -Roch

    Thread Starter incheh

    (@incheh)

    Hi Roch,

    Thanks for the swift reply.

    I have reverted back to using # as the target, but I’m still encountering my original issue.

    Menus are automatically closing on a mobile device (but only when I’m logged into the website as a user)

    E.g. I have a Fixtures & Results Menu which is using # as the target, below this menu are two sub menu items… Results and Fixtures as shown below.

    Fixtures & Results (# as target in custom link)
    Results (linked to results page)
    Fixtures (linked to fixtures page)

    When i click the top level ‘Fixtures & Results’ the sub menu items appear for a split second and then it automatically collapses.

    This is only happening on a mobile device when logged in.

    Any thoughts would be appreciated.

    Many thanks

    Roch

    (@rochesterj)

    Hi!

    That’s very weird!

    Please kindly send us a link to your site. If possible, please allow registration for a day or so so we can create a subscriber account just to see the issue in action.

    Thanks!

    Kind Regards,
    -Roch

    Thread Starter incheh

    (@incheh)

    Hi Roch,

    I have overcome the problem by using Navshift plugin, which creates more user friendly menus for mobile users.

    Thanks anyway.

    Roch

    (@rochesterj)

    Hi!

    I’m glad it’s resolved!

    Please, let us know if you need anything else.

    Kind Regards,
    -Roch

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Link URL removal’ is closed to new replies.