This code is not working in my widget

  • Unknown's avatar

    I am trying to create a login widget to take my students and their parents from my WordPress site to the My Music Staff website. This is the code that is provided from the My Music Staff website to create this login portal.
    https://login.mymusicstaff.com/Widget/v2/Login.ashx

    It is in javascript, I’m pretty sure…but I don’t write code. I see that this may not be acceptable on WordPress. Is there a way to make it work?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi leslieplaysmusic,

    You will not be able to add this code to your site, as it is JavaScript, which you are unable to add to WordPress.com-hosted sites. This is for security purposes.

    As an alternative, you can just create a link to your other site’s login page, using basic HTML, which is supported on WordPress.com.

    You can read more about it here: https://en.support.wordpress.com/code/

    I hope this helps!

    Regards,
    Jay

  • Unknown's avatar

    Howdy leslieplaysmusic,

    WordPress.com only allows a limited set of code for security reasons. You would not be able to add this particular code. You can however link to the form from your page.

    To learn more about what code is allowed at WordPress.com, click here.

    Let me know if you have any other questions.

    ~Chris

  • Unknown's avatar

    Hi leslieplaysmusic,

    The Javascript you supplied won’t work on WordPress.com but you can create your own widget by adding text and link to the login page:

    <a href="https://login.mymusicstaff.com">Login</a>

    Just paste the link into the ‘Text’ tab of the widget. The end of the URL contained references to the widget so I’ve removed that and included just the login URL. This can be updated if it isn’t quite right.

  • The topic ‘This code is not working in my widget’ is closed to new replies.