Title: Using shortcode two times problem
Last modified: August 22, 2016

---

# Using shortcode two times problem

 *  Resolved [JohnVizer](https://wordpress.org/support/users/johnvizer/)
 * (@johnvizer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/)
 * Hi,
 * So on my site I would have on top right a Login button where a modal box pops
   up and with sections for registering and login. I use ajax_login and ajax_register
   in that modal box. That works all good and stuff.
 * But I also have 2 pages for registration and login which include the same 2 shortcodes.
   However, if let’s say the person goes to the registration page and clicks on 
   top right login button to login or register via there and it pops up a modalbox
   which have a login/register, it won’t display the registration form because the
   registration form is already loaded on the registration page, but the login form
   in the modalbox is present.
 * Same would happen if a person goes to the login page and clicks on the login 
   button to pop up the modalbox, he would be able to see the registration form 
   but not the login form. Any idea why this is happening?
 * You can replicate the same thing just by adding [ajax_register] or [ajax_login]
   two times on a page. it will only load 1 register form and/or 1 loginform, and
   not 2. However this isn’t so handy since i use a modalbox that is present on 
   the entire site. Any idea how to get this fixed?
 * I’ve sent you guys an e-mail today with my site’s address in it so you can always
   go to it and see for yourself if my story is a little confusing.
 * [https://wordpress.org/plugins/zm-ajax-login-register/](https://wordpress.org/plugins/zm-ajax-login-register/)

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

 *  Plugin Contributor [Diana](https://wordpress.org/support/users/dvk/)
 * (@dvk)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225323)
 * John,
 * You don’t need to use the shortcode twice in a page if your intention is solely
   to use the modal boxes.
    ** If you want to simply use the modal boxes, do this:
       1. Delete the `[ajax_login]` or `[ajax_register]` shortcodes from any pages 
          or posts.
    -  1.  Under advance usage, you can set up the modal boxes by creating a registration
          and/or login handle. Meaning, create your own unique css class for the login
          or registration pop up window.
       2. We give the sample of .register-link and .login-link, **but you can use ****.
          register-dialog** or **.login-dialog** for testing purposes.
    -  1.  Finally, if you want to see the dialogs as menu item add the login/register
          modals to existing menu. Go to Appearance—Menus and follow directions below
    - Use these values:
       url: # (you can even put a / here as WordPress wants some
      value) Navigation label: Login CSS Class: login-dialog (this should be as 
      you indicated in your advance usage) Save
    - add another one for registration (if you want, meaning you don’t need to have
      two menu options)
       url: # Navigation label: Register CSS Class: register-dialog
 * Be sure to allow “Anyone can register” under your regular settings.
 * Here is another tutorial Zane put on our blog. I hope this helps.
    [Adding a Login 
   Dialog Modal
 *  Thread Starter [JohnVizer](https://wordpress.org/support/users/johnvizer/)
 * (@johnvizer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225439)
 * Hi,
 * Well I took that route, I know about your plugin for a long time and I have used
   the handlers and all that and they work all nicely.
 * Just that the problem is that when a person enters the wrong information during
   login, he doesn’t really get a message that says that it’s wrong. There’s simply
   nothing being displayed except if it’s the right login details and I remember
   this problem being there the first time I used this plugin which is like almost
   a year ago. So not sure, could you guys give me a fix for that login issue?
 *  Plugin Author [Zane Matthew](https://wordpress.org/support/users/zanematthew/)
 * (@zanematthew)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225485)
 * Hi,
 * Thanks for using the plugin, glad you’ve been able to use it for a long time (
   and hopefully longer 😉
 * I do remember the issue, and I’ve [re-opened it](https://github.com/zanematthew/zm-ajax-login-register/issues/14).
   I can see how this can be a problem, as I’ve never tested it with that exact 
   set-up.
 * Considering a fix is found this would be available in the next update, which 
   may be out in the next few weeks. Currently we’re updating the Pro version with
   a few security features.
 * Again, thanks for sharing and brining this to our attention.
 *  Thread Starter [JohnVizer](https://wordpress.org/support/users/johnvizer/)
 * (@johnvizer)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225493)
 * Ah ok, what if I purchase the Pro version right now, would you guys be able to
   code that feature in for me?
 *  Plugin Author [Zane Matthew](https://wordpress.org/support/users/zanematthew/)
 * (@zanematthew)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225646)
 * Hi John,
 * This is an issue in both versions, and I’m fixing it in the free and Pro version.
   Currently I have a few releases scheduled for this week. So expect an update 
   then.

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

The topic ‘Using shortcode two times problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/zm-ajax-login-register_479bd1.svg)
 * [ZM Ajax Login & Register](https://wordpress.org/plugins/zm-ajax-login-register/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/zm-ajax-login-register/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/zm-ajax-login-register/)
 * [Active Topics](https://wordpress.org/support/plugin/zm-ajax-login-register/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/zm-ajax-login-register/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/zm-ajax-login-register/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Zane Matthew](https://wordpress.org/support/users/zanematthew/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/using-shortcode-two-times-problem/#post-5225646)
 * Status: resolved