using this from a primary menu item
-
I have this code in my functions.php child theme file.
$login_url = site_url('wp-login.php'); $items .= "<li class='sub-menu'><a href='$login_url' class='lwa-links-modal'>Log In</a></li>";
It is part of a callback on the filter ‘wp_nav_menu_items’ to make a modal login launch from the primary menu using this plugin.
However clicking on the ‘Log In’ link does nothing. Turning on firebug and looking at the console.log shows this error. “TypeError: target is undefined” and dumps the minimized code for login-with-ajax.js.
Update: chrome debug console tab gives this error: “Uncaught TypeError: Cannot call method ‘reveal’ of undefined“, so apparently somethiing is undefined when used this way. Also I should add that this plugin works fine as modal from a link in the sidebar widget.
Changing the class name from lwa-links-modal’ to anything else makes the “target” link active again which is the normal wp-login.php form.
Has anyone else got this plugin to work as a modal popup from a menu item? If so what code did you use?
Thanks, Ron
https://www.ads-software.com/extend/plugins/login-with-ajax/
- The topic ‘using this from a primary menu item’ is closed to new replies.